I have a form that on it, I've got information from database. Now I want to check just a record on it and it is : Is it possible that I check the string value of that field and if it was encrypted or not, for response I return true or false!! How can I solve this issue??
Asked
Active
Viewed 3,135 times
-1
-
What do you mean by encrypted? With what function? – Traian Tatic Sep 09 '14 at 06:25
-
I think It will help you http://stackoverflow.com/questions/16556375/how-to-use-aes-encrypt-and-aes-decrypt-in-mysql – Punitha Subramani Sep 09 '14 at 06:31
-
SELECT IF(CAST(AES_DECRYPT(AES_ENCRYPT(col_name,''),'') as char)=col_name,'true','false') from tbl_name; – Punitha Subramani Sep 09 '14 at 06:49
2 Answers
0
Check the encrypted of decrypted of the value is equivalent to the input text

Akshaya Moorthy
- 309
- 3
- 11
0
To check if it's encrypted you need the key that has encrypted the value.
SELECT if(AES_DECRYPT(`cloumn`, 'encyrption key...') is null, 'false','true') FROM `table`
If you don't have the key you could maybe try testing a certain language signature (the amount of occurences in the string of certain characters). The type of encryption would be rather difficult to detect.

Chris Hemmens
- 367
- 2
- 11