Which encryption algorithm is 100% secure?

Source: Internet
Author: User
Which encryption algorithm is 100% secure? OTP!
OTP (one-time-pad, one password at a time) is the only password proved to be undeciphable in mathematics. OTP is generally only used in situations where secrets are extremely important: military and diplomatic affairs. However, because the key length is very long and it is very difficult to store and exchange keys securely, OTP is not applicable to many occasions. Therefore, in practice, OTP is not used for encryption, but symmetric encryption is used.
The following is an example of OTP encryption: Public static string generatesalt (INT size) // create a salt value
{
// Create a strong random number
Rngcryptoserviceprovider crypto = new rngcryptoserviceprovider ();
Byte [] buff = new byte [size];
Crypto. getbytes (buff );
Return convert. tobase64string (buff );
}
Public static string generatepwdhash (string PWD, string salt) // Encrypt
{
String saltpwd = string. Concat (PWD, salt); // combine the plain text with the salt value
String Password = formsauthentication. hashpasswordforstoringinconfigfile (saltpwd, "sha1 ");
Return password;
}

The rngcryptoserviceprovider class inherits from cryptoserviceprovider (CSP) and is used to generate a strong random number. It has the same functions as the Radom function of VB 6.0,. net PRNG (pseudo-random number generator) produces a much better random number quality.

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.