I have a table (Users) with 2 rows
nameUser como varchar(50)
passUser como varbinary(200)
The question is that I am entering test data for later processing but I have noticed that entering the same password gives different encryption, for example, to insert values I am using this line of code:
INSERT INTO Users(nameUser, passUser)VALUES('gato',
EncryptbyPassphrase('keySecret','perro'))
but when I show the table, this comes out:
IF I am using the same key (keySecret) and the same text (dog), do not they have to give me exactly the same?
I am also trying (according to me) to do a SELECT validating that the pass is equal to what is entered
SELECT nameUser
FROM Users
WHERE passUser=EncryptbyPassphrase('keySecret','perro')
I would appreciate knowing why the same EncryptbyPassphrase
does not matter.