C# 클래스 Crypto.CryptoManager

Encrypts un-ciphered data and decrypts ciphered data
based on the example demonstrating how to encrypt and decrypt sample data using the Aes class on MSDN http://msdn.microsoft.com/en-us/library/system.security.cryptography.aes.aes.aspx
파일 보기 프로젝트 열기: jgcoding/J-SQL 1 사용 예제들

공개 메소드들

메소드 설명
CryptoManager ( ) : System
DecryptAES ( byte cipheredPayload, CryptoLevel keysize = CryptoLevel.AES256 ) : byte[]

Decrypts a cyphered key and returns it as clear text

EncryptAES ( byte clearPayload, CryptoLevel keysize = CryptoLevel.AES256 ) : byte[]

Encrypts the un-cyphered data as an array of bytes

GenerateNonce ( Int32 length = 8 ) : byte[]

Generates a random value derived from a set of pre-defined alphanumeric characters.

SetEncryptionLevel ( CryptoLevel keysize = CryptoLevel.AES256 ) : void

Sets or resets the encryption level for the encryption instance

비공개 메소드들

메소드 설명
ConfigureCryptoInCode ( ) : void

Loads the crypto properties from hard-coded values. At this time, utilizing an encrypted app.config is not in the specifications.

메소드 상세

CryptoManager() 공개 메소드

public CryptoManager ( ) : System
리턴 System

DecryptAES() 공개 메소드

Decrypts a cyphered key and returns it as clear text
public DecryptAES ( byte cipheredPayload, CryptoLevel keysize = CryptoLevel.AES256 ) : byte[]
cipheredPayload byte
keysize CryptoLevel
리턴 byte[]

EncryptAES() 공개 메소드

Encrypts the un-cyphered data as an array of bytes
public EncryptAES ( byte clearPayload, CryptoLevel keysize = CryptoLevel.AES256 ) : byte[]
clearPayload byte The un-ciphered data to be encrypted
keysize CryptoLevel
리턴 byte[]

GenerateNonce() 공개 메소드

Generates a random value derived from a set of pre-defined alphanumeric characters.
public GenerateNonce ( Int32 length = 8 ) : byte[]
length System.Int32 The length of the random value string
리턴 byte[]

SetEncryptionLevel() 공개 메소드

Sets or resets the encryption level for the encryption instance
public SetEncryptionLevel ( CryptoLevel keysize = CryptoLevel.AES256 ) : void
keysize CryptoLevel The encryption level as an CryptoLevel enum
리턴 void