TripleDES.IsWeakKey(Byte[]) Método

Definição

Determina se a chave especificada é fraca.Determines whether the specified key is weak.

public:
 static bool IsWeakKey(cli::array <System::Byte> ^ rgbKey);
public static bool IsWeakKey (byte[] rgbKey);
static member IsWeakKey : byte[] -> bool
Public Shared Function IsWeakKey (rgbKey As Byte()) As Boolean

Parâmetros

rgbKey
Byte[]

A chave secreta cuja vulnerabilidade será testada.The secret key to test for weakness.

Retornos

Boolean

true se a chave for fraca; caso contrário, false.true if the key is weak; otherwise, false.

Exceções

O tamanho do parâmetro rgbKey não é válido.The size of the rgbKey parameter is not valid.

Comentários

Chaves fracas são chaves que resultam em codificações que são fáceis de quebrar.Weak keys are keys that result in ciphers that are easy to break. Se o texto for criptografado com uma chave fraca, a criptografia da codificação resultante novamente com a mesma chave fraca retornará o texto original.If text is encrypted with a weak key, encrypting the resulting cipher again with the same weak key returns the original text. No modo de 128 bits, se os primeiros 64 bits forem iguais aos últimos 64 bits, a chave será fraca.In 128-bit mode, if the first 64 bits are the same as the last 64 bits, the key is weak. No modo de 192 bits, se os primeiros 64 bits forem iguais aos do segundo 64 bits ou se os segundo bits 64 forem os mesmos que os últimos 64 bits, a chave será fraca.In 192-bit mode, if the first 64 bits are the same as the second 64 bits or if the second 64 bits are the same as the last 64 bits, the key is weak.

A tentativa de definir um resultado de chave fraca em um CryptographicException .Attempting to set a weak key results in a CryptographicException. Quando GenerateKey é chamado para criar uma chave aleatória, uma chave fraca nunca será retornada.When GenerateKey is called to create a random key, a weak key will never be returned.

Aplica-se a