A simple example of the use of 3DES encryption

Source: Internet
Author: User
Feed
Namespaces: System.Security.Cryptography.TripleDES Class
Simple description: Represents the base class for triple data Encryption standard algorithms, all implementations of TripleDES must derive from this base class, but TripleDES is inherited from the SymmetricAlgorithm class. TripleDES uses the DES algorithm for three consecutive iterations. It can use two or three 56-bit keys.
Purpose of Use: Secure encryption a way, the difference between the key and the vector, will produce different cryptographic strings. Because it is the three consecutive iterations of the DES algorithm, and the algorithm is reversible, it is good for data confidentiality and recoverability.
How to: direct string input and output.
Second, the code example
This code refers to some of the code examples on MSDN and, based on its own circumstances, supplements a portion of what is not mentioned on MSDN

Using System;
Using System.Security;
Using System.Security.Cryptography;
Using System.IO;
Using System.Text;
Using System.Threading;

Namespace Trip3des
{
///
Summary description of the CLASS1.
///
public class Dllencrypt
{
Secret key
Private Const string SKey = "QJZGEH6HESZDVJECNFPGUXZAIB7NLQM3";
Vector, vector can be empty
Private Const string SIV = "qcdy6x+aplw=";
Construct a symmetric algorithm
Private SymmetricAlgorithm MCSP = new TripleDESCryptoServiceProvider ();

Public Dllencrypt () {}

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.