funcion ENCRYPT

ecdl
16 de Abril del 2004
tengo un problema con una BBDD en MYSQL. tengo una tabla con usuarios con nombres y password entre otras cosas.

el campo del password está guardado mediante la funcion ENCRYPT.

como puedo validar esa contraseña, comparando con otra sin encriptar?

es que la funcion ENCRYPT, devuelve un resultado distinto para la misma cadena cada vez que se ejecuta.

alguna idea?¿

gracias...

Bobo.com
16 de Abril del 2004
AES_ENCRYPT(string,key_string)
AES_DECRYPT(string,key_string)
These functions allow encryption/decryption of data using the official AES (Advanced Encryption Standard) algorithm, previously known as Rijndael. Encoding with a 128-bit key length is used, but you can extend it up to 256 bits by modifying the source. We chose 128 bits because it is much faster and it is usually secure enough. The input arguments may be any length. If either argument is NULL, the result of this function is also NULL. As AES is a block-level algorithm, padding is used to encode uneven length strings and so the result string length may be calculated as 16*(trunc(string_length/16)+1). If AES_DECRYPT() detects invalid data or incorrect padding, it returns NULL. However, it is possible for AES_DECRYPT() to return a non-NULL value (possibly garbage) if the input data or the key are invalid. You can use the AES functions to store data in an encrypted form by modifying your queries: