C# 클래스 FlexiWebSDK.Crypto.BlowfishCrypt

상속: ICryptProvider
파일 보기 프로젝트 열기: FlexiDB/PublicCSharpLib

공개 메소드들

메소드 설명
BlowfishCrypt ( ) : System
BlowfishCrypt ( byte cipherKey ) : System

Constructor for byte key

BlowfishCrypt ( string hexKey ) : System

Constructor for hex key

Crypt_CTR ( byte text, int numThreads ) : byte[]
Decrypt ( string ct ) : string
Decrypt_CBC ( byte ct ) : byte[]

Decrypts a byte array in CBC mode. IV must be created and saved manually.

Decrypt_CBC ( string ct ) : string

Decrypts a string in CBC mode

Decrypt_CTR ( string ct ) : string

Decrypt a string (CTR)

Decrypt_ECB ( byte ct ) : byte[]

Decrypts a byte array (ECB)

Decrypt_ECB ( string ct ) : string

Decrypts a string (ECB)

Encrypt ( string pt ) : string
Encrypt_CBC ( byte pt ) : byte[]

Encrypts a byte array in CBC mode. IV must be created and saved manually.

Encrypt_CBC ( string pt ) : string

Encrypts a string in CBC mode

Encrypt_CTR ( string pt ) : string

Encrypts a string (CTR)

Encrypt_ECB ( byte pt ) : byte[]

Encrypts a byte array in ECB mode

Encrypt_ECB ( string pt ) : string

Encrypt a string in ECB mode

SetKey ( byte key ) : void
SetKey ( string key ) : void
SetRandomIV ( ) : byte[]

Creates and sets a random initialization vector.

비공개 메소드들

메소드 설명
BlockDecrypt ( byte &block ) : void

Decrypts a 64 bit block

BlockEncrypt ( byte &block ) : void

Encrypts a 64 bit block

ByteToHex ( byte bytes ) : string
Crypt_CBC ( byte text, bool decrypt ) : byte[]

Encrypts or decrypts data in CBC mode

Crypt_ECB ( byte text, bool decrypt ) : byte[]

Encrypts or decrypts data in ECB mode

GetBlock ( byte &block ) : void

Converts the two uint values into a 64 bit block

GetHex ( char x ) : byte
HexToByte ( string hex ) : byte[]
SetBlock ( byte block ) : void

Splits the block into the two uint values

SetupKey ( byte cipherKey ) : void

Sets up the S-blocks and the key

SetupP ( ) : uint[]
SetupS0 ( ) : uint[]
SetupS1 ( ) : uint[]
SetupS2 ( ) : uint[]
SetupS3 ( ) : uint[]
XorBlock ( byte &block, byte iv ) : void

XoR encrypts two 8 bit blocks

decipher ( ) : void

Runs the blowfish algorithm in reverse (standard 16 rounds)

encipher ( ) : void

Runs the blowfish algorithm (standard 16 rounds)

round ( uint a, uint b, uint n ) : uint

one round of the blowfish algorithm

wordByte0 ( uint w ) : byte
wordByte1 ( uint w ) : byte
wordByte2 ( uint w ) : byte
wordByte3 ( uint w ) : byte

메소드 상세

BlowfishCrypt() 공개 메소드

public BlowfishCrypt ( ) : System
리턴 System

BlowfishCrypt() 공개 메소드

Constructor for byte key
public BlowfishCrypt ( byte cipherKey ) : System
cipherKey byte Cipher key as a byte array
리턴 System

BlowfishCrypt() 공개 메소드

Constructor for hex key
public BlowfishCrypt ( string hexKey ) : System
hexKey string Cipher key as a hex string
리턴 System

Crypt_CTR() 공개 메소드

public Crypt_CTR ( byte text, int numThreads ) : byte[]
text byte
numThreads int
리턴 byte[]

Decrypt() 공개 메소드

public Decrypt ( string ct ) : string
ct string
리턴 string

Decrypt_CBC() 공개 메소드

Decrypts a byte array in CBC mode. IV must be created and saved manually.
public Decrypt_CBC ( byte ct ) : byte[]
ct byte Ciphertext data to decrypt
리턴 byte[]

Decrypt_CBC() 공개 메소드

Decrypts a string in CBC mode
public Decrypt_CBC ( string ct ) : string
ct string Ciphertext with IV appended to front
리턴 string

Decrypt_CTR() 공개 메소드

Decrypt a string (CTR)
public Decrypt_CTR ( string ct ) : string
ct string The ciphertext to decrypt
리턴 string

Decrypt_ECB() 공개 메소드

Decrypts a byte array (ECB)
public Decrypt_ECB ( byte ct ) : byte[]
ct byte Ciphertext byte array
리턴 byte[]

Decrypt_ECB() 공개 메소드

Decrypts a string (ECB)
public Decrypt_ECB ( string ct ) : string
ct string hHex string of the ciphertext
리턴 string

Encrypt() 공개 메소드

public Encrypt ( string pt ) : string
pt string
리턴 string

Encrypt_CBC() 공개 메소드

Encrypts a byte array in CBC mode. IV must be created and saved manually.
public Encrypt_CBC ( byte pt ) : byte[]
pt byte Plaintext data to encrypt
리턴 byte[]

Encrypt_CBC() 공개 메소드

Encrypts a string in CBC mode
public Encrypt_CBC ( string pt ) : string
pt string Plaintext data to encrypt
리턴 string

Encrypt_CTR() 공개 메소드

Encrypts a string (CTR)
public Encrypt_CTR ( string pt ) : string
pt string The plaintext to encrypt
리턴 string

Encrypt_ECB() 공개 메소드

Encrypts a byte array in ECB mode
public Encrypt_ECB ( byte pt ) : byte[]
pt byte Plaintext data
리턴 byte[]

Encrypt_ECB() 공개 메소드

Encrypt a string in ECB mode
public Encrypt_ECB ( string pt ) : string
pt string Plaintext to encrypt as ascii string
리턴 string

SetKey() 공개 메소드

public SetKey ( byte key ) : void
key byte
리턴 void

SetKey() 공개 메소드

public SetKey ( string key ) : void
key string
리턴 void

SetRandomIV() 공개 메소드

Creates and sets a random initialization vector.
public SetRandomIV ( ) : byte[]
리턴 byte[]