MD5 and sha1 are one-way encryption
Algorithm It is often used for password verification and other scenarios requiring encryption operations. In general, developers can write related functions themselves or use their own functions through Delphi or
Instance
Computes the SHA-1 hash of the string "Hello":
Definition and usage
The SHA1 () function computes the SHA-1 hash of the string.
The SHA1 () function uses the United States Secure Hash algorithm 1.
Explanation from RFC 3174-the US Secure
Today in docking other people's system, found a very pit problem, SHA1 encryption problem
Others system SHA1 encryption is written in PHP, we are C #.
The same is true for string 123456 encryption, C # 's SHA1 encrypted string is
I have been studying base64 and sha1 in Delphi today, using units in cnvcl of http://www.cnpack.org, cnsha1.pas and cnbase64.pas. I am very grateful for the contributions of the cnpack group, we can easily use base64 and sha1 encryption in Delphi,
Because of different languages, the rules for encryption are slightly different. Then this problem in the Niang can not search a correct answer, hereby record. 1. First, the two basic algorithms need to be consistent, here are the basic rules of SHA1
Why is it wrong to judge whether the sha1 encrypted string after the POST is equal. For example, the encrypted string 356a192b7913b04c54574d18c28d46e6395428ab is returned in the form post.
Then, if ($ _ POST ['s '] = '356a192b7913b04c54574d18c28d46e6
For example, my form post came up SHA1 (' 1 ') this encrypted string 356a192b7913b04c54574d18c28d46e6395428ab.
Then I if ($_post[' s ']== ' 356a192b7913b04c54574d18c28d46e6395428ab ')
Why is it judged false?
echo $_post[' s '] is also 356a192b7913b04
Problem
What is PHP file? which software can be used to open
Workaround
PHP, a nested abbreviated name, is an abbreviation for the English Super Text preprocessing language (Php:hypertext preprocessor). PHP is an HTML embedded language, PHP and
Originally intended to write their own, but see the complexity of the algorithm described on the shrink. Forget it, there are ready-made COM object calls, why to care about the algorithm, directly to use on the line. If the following example code
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.