C# Класс Dev2.Runtime.ESB.Management.Services.SecurityEncryption

This class uses a symmetric key algorithm (Rijndael/AES) to encrypt and decrypt data. As long as encryption and decryption routines use the same parameters to generate the keys, the keys are guaranteed to be the same. The class uses static functions with duplicate code to make it easier to demonstrate encryption and decryption logic. In a real-life application, this may not be the most efficient way of handling encryption, so - as soon as you feel comfortable with it - you may want to redesign this class.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Decrypt ( string cipherText ) : string

Decrypts specified ciphertext using Rijndael symmetric key algorithm.

Most of the logic in this function is similar to the Encrypt logic. In order for decryption to work, all parameters of this function - except cipherText value - must match the corresponding parameters of the Encrypt function which was called to generate the ciphertext.

Encrypt ( string plainText ) : string

Encrypts specified plaintext using Rijndael symmetric key algorithm and returns a base64-encoded result.

Описание методов

Decrypt() публичный статический Метод

Decrypts specified ciphertext using Rijndael symmetric key algorithm.
Most of the logic in this function is similar to the Encrypt logic. In order for decryption to work, all parameters of this function - except cipherText value - must match the corresponding parameters of the Encrypt function which was called to generate the ciphertext.
public static Decrypt ( string cipherText ) : string
cipherText string /// Base64-formatted ciphertext value. ///
Результат string

Encrypt() публичный статический Метод

Encrypts specified plaintext using Rijndael symmetric key algorithm and returns a base64-encoded result.
public static Encrypt ( string plainText ) : string
plainText string /// Plaintext value to be encrypted. ///
Результат string