C# 클래스 SebWindowsClient.CryptographyUtils.AESThenHMAC

Class for encrypting and decrypting with AES and HMAC, compatible with RNCryptor on Mac OS X and iOS.
파일 보기 프로젝트 열기: SafeExamBrowser/seb-win 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
BlockBitSize int
Iterations int
KeyBitSize int
MinPasswordLength int
SaltBitSize int

공개 메소드들

메소드 설명
NewKey ( ) : byte[]

Helper that generates a random key on each call.

SimpleDecrypt ( byte encryptedMessage, byte cryptKey, byte authKey, int nonSecretPayloadLength ) : byte[]
SimpleDecrypt ( string encryptedMessage, byte cryptKey, byte authKey, int nonSecretPayloadLength ) : string

Simple Authentication (HMAC) then Decryption (AES) for a secrets UTF8 Message.

SimpleDecryptWithPassword ( byte encryptedMessage, string password, int nonSecretPayloadLength ) : byte[]
SimpleDecryptWithPassword ( string encryptedMessage, string password, int nonSecretPayloadLength ) : string

Simple Authentication (HMAC) and then Descryption (AES) of a UTF8 Message using keys derived from a password (PBKDF2).

Significantly less secure than using random binary keys.

SimpleEncrypt ( byte secretMessage, byte cryptKey, byte authKey, byte nonSecretPayload = null ) : byte[]
SimpleEncrypt ( string secretMessage, byte cryptKey, byte authKey, byte nonSecretPayload = null ) : string

Simple Encryption (AES) then Authentication (HMAC) for a UTF8 Message.

Adds overhead of (Optional-Payload + BlockSize(16) + Message-Padded-To-Blocksize + HMac-Tag(32)) * 1.33 Base64

SimpleEncryptWithPassword ( byte secretMessage, string password, byte nonSecretPayload = null ) : byte[]
SimpleEncryptWithPassword ( string secretMessage, string password, byte nonSecretPayload = null ) : string

Simple Encryption (AES) then Authentication (HMAC) of a UTF8 message using Keys derived from a Password (PBKDF2).

Significantly less secure than using random binary keys. Adds additional non secret payload for key generation parameters.

메소드 상세

NewKey() 공개 정적인 메소드

Helper that generates a random key on each call.
public static NewKey ( ) : byte[]
리턴 byte[]

SimpleDecrypt() 공개 정적인 메소드

public static SimpleDecrypt ( byte encryptedMessage, byte cryptKey, byte authKey, int nonSecretPayloadLength ) : byte[]
encryptedMessage byte
cryptKey byte
authKey byte
nonSecretPayloadLength int
리턴 byte[]

SimpleDecrypt() 공개 정적인 메소드

Simple Authentication (HMAC) then Decryption (AES) for a secrets UTF8 Message.
Encrypted Message Required!;encryptedMessage
public static SimpleDecrypt ( string encryptedMessage, byte cryptKey, byte authKey, int nonSecretPayloadLength ) : string
encryptedMessage string The encrypted message.
cryptKey byte The crypt key.
authKey byte The auth key.
nonSecretPayloadLength int Length of the non secret payload.
리턴 string

SimpleDecryptWithPassword() 공개 정적인 메소드

public static SimpleDecryptWithPassword ( byte encryptedMessage, string password, int nonSecretPayloadLength ) : byte[]
encryptedMessage byte
password string
nonSecretPayloadLength int
리턴 byte[]

SimpleDecryptWithPassword() 공개 정적인 메소드

Simple Authentication (HMAC) and then Descryption (AES) of a UTF8 Message using keys derived from a password (PBKDF2).
Significantly less secure than using random binary keys.
Encrypted Message Required!;encryptedMessage
public static SimpleDecryptWithPassword ( string encryptedMessage, string password, int nonSecretPayloadLength ) : string
encryptedMessage string The encrypted message.
password string The password.
nonSecretPayloadLength int Length of the non secret payload.
리턴 string

SimpleEncrypt() 공개 정적인 메소드

public static SimpleEncrypt ( byte secretMessage, byte cryptKey, byte authKey, byte nonSecretPayload = null ) : byte[]
secretMessage byte
cryptKey byte
authKey byte
nonSecretPayload byte
리턴 byte[]

SimpleEncrypt() 공개 정적인 메소드

Simple Encryption (AES) then Authentication (HMAC) for a UTF8 Message.
Adds overhead of (Optional-Payload + BlockSize(16) + Message-Padded-To-Blocksize + HMac-Tag(32)) * 1.33 Base64
Secret Message Required!;secretMessage
public static SimpleEncrypt ( string secretMessage, byte cryptKey, byte authKey, byte nonSecretPayload = null ) : string
secretMessage string The secret message.
cryptKey byte The crypt key.
authKey byte The auth key.
nonSecretPayload byte (Optional) Non-Secret Payload.
리턴 string

SimpleEncryptWithPassword() 공개 정적인 메소드

public static SimpleEncryptWithPassword ( byte secretMessage, string password, byte nonSecretPayload = null ) : byte[]
secretMessage byte
password string
nonSecretPayload byte
리턴 byte[]

SimpleEncryptWithPassword() 공개 정적인 메소드

Simple Encryption (AES) then Authentication (HMAC) of a UTF8 message using Keys derived from a Password (PBKDF2).
Significantly less secure than using random binary keys. Adds additional non secret payload for key generation parameters.
password
public static SimpleEncryptWithPassword ( string secretMessage, string password, byte nonSecretPayload = null ) : string
secretMessage string The secret message.
password string The password.
nonSecretPayload byte The non secret payload.
리턴 string

프로퍼티 상세

BlockBitSize 공개적으로 정적으로 프로퍼티

public static int BlockBitSize
리턴 int

Iterations 공개적으로 정적으로 프로퍼티

public static int Iterations
리턴 int

KeyBitSize 공개적으로 정적으로 프로퍼티

public static int KeyBitSize
리턴 int

MinPasswordLength 공개적으로 정적으로 프로퍼티

public static int MinPasswordLength
리턴 int

SaltBitSize 공개적으로 정적으로 프로퍼티

public static int SaltBitSize
리턴 int