BASE64-based encryption coding auxiliary class Base64util

Source: Internet
Author: User

Achieve Results1) This auxiliary class is mainly used to facilitate the implementation of BASE64-based encryption coding. 2) Base64 is defined as: the Base64 Content transfer code is designed to describe any sequence of 8 bytes as a form that is not easy to be recognized directly. BASE64 encoding is typically found in e-mail messages, open an email to view its original information (you can view it by collecting and exporting the message in a text editor). Encryption is positive, but the purpose of encryption is not to send users a very secure email. This type of encryption is mainly "anti-gentleman against the villain."  That is, to reach a glance to completely see the content can be. 3) using BASE64 encoding is not only short, but also has the non-readability, that is, the encoded data will not be directly visible to the human eye.

<summary>

Encrypt a string using the default password table

</summary>

<param name= "Input" > string to encrypt </param>

<returns></returns>

public static string Encrypt (String input)

<summary>

Decrypting a string using the default password table

</summary>

<param name= "Input" > string to Decrypt </param>

<returns></returns>

public static string Decrypt (String input)

<summary>

Gets the cryptographic class with the standard Base64 cipher table

</summary>

<returns></returns>
public static Base64util GetStandardBase64 ()

、、、、、、、、、、、、、

private void Btnbase64_click (object sender, EventArgs e)

{

String original = "This is a test of the Base64 cryptographic string";

String encrypt = Base64util.encrypt (original);

Console.WriteLine (encrypt);//output content: 6l*z5pi_5lia5liq5rwl6k*v55qeqmfzzty05yqg5b*g5b2x56ym5liy

String decrypt = Base64util.decrypt (encrypt);

Debug.Assert (original = = decrypt);//Verify Equality

}

Base64-based encryption-Encoding helper class Base64util

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.