Home > Back-end >  How to "a123456?" Encrypted with a control character string?
How to "a123456?" Encrypted with a control character string?

Time:01-04


Cipher with control characters (see annex), are now known to Java, python by sha1, base64 can only get after "lV24u03FDKBAhxdpcyEQgK1GSxw=" (in front of all the same, just don't take control characters), can be in the database is the picture of the cipher text, how to encrypt have this effect, not encrypt the image of the way, I cannot be accurately query is a query, accurate query must username login password? :
@ Query (name="loginbyIdAndPwd," nativeQuery=true, value=https://bbs.csdn.net/topics/
"Select * from UA_User_Ex where cUser_Id=: cUser_Id and cPassword=: cPassword")
CUser_Id UaUserEx loginbyIdAndPwd (@ Param (" ") String cUser_Id, @ Param (" cPassword ") String cPassword);

CodePudding user response:

1 you want is encrypted or hash (hash), encryption can be decrypted, hash, do not restore the original
2 control characters is part of a string, such as \ r \ n \ t, is character set does not contain the Numbers you want to?
No matter sha1 aes encryption method etc, the output is a binary array, is likely to have control of operators and base64 converts binary values to a string
3 what is your database field, if it is a string class or binary class

CodePudding user response:

Use the MSSQL server 2008, database is the field type nvarchar, no matter what method you use, is to get the "a123456?" Get "lV24u03FDKBAhxdpcyEQgK1GSxw=" (a control character, see the attachment), the question now is, by what method? Saved in the database is "lV24u03FDKBAhxdpcyEQgK1GSxw=" (a control character, see the attachment)
  • Related