C# 클래스 SagaLib.Encryption

파일 보기 프로젝트 열기: Willyham/SagaRO2 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
StaticKey byte[]

공개 메소드들

메소드 설명
Crypt ( string msg, byte key, bool encrypt ) : string

Encrypt/Decrypt a given message with a given key.

Decrypt ( byte data, int offset, byte key ) : byte[]

Decrypt a byte array with a given key.

Encrypt ( byte data, int offset, byte key ) : byte[]

Encrypt a byte array with a given key.

GenerateDecExpKey ( byte key ) : byte[]

Generate the expanded key that will be used during decryption.

GenerateKey ( ) : byte[]

Generate a random 16 bytes AES key.

비공개 메소드들

메소드 설명
Crypt ( byte data, int offset, byte orgkey, bool encrypt ) : byte[]
SwapBytes ( byte buffer, int len, int c ) : void

메소드 상세

Crypt() 공개 정적인 메소드

Encrypt/Decrypt a given message with a given key.
public static Crypt ( string msg, byte key, bool encrypt ) : string
msg string msg to encrypt/decrypt
key byte aes key to use
encrypt bool true: message will be encrypted. false: message will be decrypted.
리턴 string

Decrypt() 공개 정적인 메소드

Decrypt a byte array with a given key.
public static Decrypt ( byte data, int offset, byte key ) : byte[]
data byte bytes to decrypt
offset int
key byte aes key to use
리턴 byte[]

Encrypt() 공개 정적인 메소드

Encrypt a byte array with a given key.
public static Encrypt ( byte data, int offset, byte key ) : byte[]
data byte bytes to encrypt
offset int
key byte aes key to use
리턴 byte[]

GenerateDecExpKey() 공개 정적인 메소드

Generate the expanded key that will be used during decryption.
public static GenerateDecExpKey ( byte key ) : byte[]
key byte AES key to expand.
리턴 byte[]

GenerateKey() 공개 정적인 메소드

Generate a random 16 bytes AES key.
public static GenerateKey ( ) : byte[]
리턴 byte[]

프로퍼티 상세

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

The static key is the key used to encrypt the first messages between client and server. In these messages a key exchange will take place which will be used for further communication.
public static byte[] StaticKey
리턴 byte[]