Decrypting password in a database
Posted: Thu Aug 15, 2013 7:20 pm
Hi, I have a database file containing a table UaP with the fields of Username and Password
The password is salted and encrypted and then stored in the database.
However, when I try to take out the value and decrypt it, it doesnt return anything even though I could get the password
put revOpenDatabase("sqlite",path, , , , ) into connID
put revDataFromQuery(tab,return,connID,"SELECT Username FROM UaP where Username like 'User'") into gname
put revDataFromQuery(tab,return,connID,"SELECT Password FROM UaP") into gpw
answer gpw (return "Salted__rtyudfgh†N'AÖÅaKž4XJÌŸ" which is the correct value of the encrypted password)
put "poilkjqweasd123!@#" into tPassword
put "rtyudfgh" into tSalt
decrypt gpw using "aes256" with password tPassword and salt tSalt
put it into gpw
answer gpw (returns nothing)
Is there a solution to this where I can get the password in a text form and decrypt it successfully?
I tried hardcoding the decryption process by doing
[ decrypt "Salted__rtyudfgh†N'AÖÅaKž4XJÌŸ" using "aes256" with password tPassword and salt tSalt ]
and it works fine
The password is salted and encrypted and then stored in the database.
However, when I try to take out the value and decrypt it, it doesnt return anything even though I could get the password
put revOpenDatabase("sqlite",path, , , , ) into connID
put revDataFromQuery(tab,return,connID,"SELECT Username FROM UaP where Username like 'User'") into gname
put revDataFromQuery(tab,return,connID,"SELECT Password FROM UaP") into gpw
answer gpw (return "Salted__rtyudfgh†N'AÖÅaKž4XJÌŸ" which is the correct value of the encrypted password)
put "poilkjqweasd123!@#" into tPassword
put "rtyudfgh" into tSalt
decrypt gpw using "aes256" with password tPassword and salt tSalt
put it into gpw
answer gpw (returns nothing)
Is there a solution to this where I can get the password in a text form and decrypt it successfully?
I tried hardcoding the decryption process by doing
[ decrypt "Salted__rtyudfgh†N'AÖÅaKž4XJÌŸ" using "aes256" with password tPassword and salt tSalt ]
and it works fine