C# Class NSoft.NFramework.Cryptography.CryptoTool

암호화 관련 Utility Class 입니다.
Afficher le fichier Open project: debop/NFramework

Méthodes publiques

Méthode Description
BytesToHex ( this bytes ) : string

Byte 배열을 16진수 문자열로 변환한다.

BytesToString ( this bytes, EncryptionStringFormat format = EncryptionStringFormat.HexDecimal ) : string

암호화된 Byte 배열을 지정된 형식의 문자열로 변환한다.

ClearBuffer ( this bytes ) : void

Clear the specified buffer value to 0.

ComputeHashToBytes ( this hasher, string plainText ) : byte[]

Hash 값을 계산합니다.

ComputeHashToString ( this hasher, string plainText, EncryptionStringFormat format = EncryptionStringFormat.HexDecimal ) : string

Hash 값을 계산해서, 문자열로 반환합니다.

DecryptBytes ( this encryptor, byte cipherBytes ) : byte[]

대칭형 암호화 알고르즘을 이용하여 cipherBytes를 복호화 합니다.

DecryptString ( this encryptor, Stream cipherStream ) : Stream

대칭형 암호화 알고리즘을 이용하여, cipherStream을 복호화한 스트림을 반환합니다.

DecryptString ( this encryptor, string cipherText, EncryptionStringFormat format = EncryptionStringFormat.HexDecimal ) : string

대칭형 암호화 알고리즘을 이용하여, format형태의 cipherText를 복호화합니다.

DerivePassword ( string originalPassword, int newPasswordLength ) : byte[]

보통 문자열을 SALT 를 이용해 암호화된 새로운 비밀번호를 만든다.

DerivePasswordAsText ( string originalPassword, int newPasswordLength, EncryptionStringFormat format = EncryptionStringFormat.HexDecimal ) : string

원본 문자열을 SALT 를 이용해 암호화 하여, 원하는 형식의 문자열로 반환한다.

EncryptBytes ( this encryptor, byte plainBytes ) : byte[]

대칭형 암호화 알고리즘을 이용하여 plainBytes를 암호화 합니다.

EncryptStream ( this encryptor, Stream plainStream ) : Stream

대칭형 암호화 알고리즘을 이용하여, plainStream을 암호화하여 스트림으로 반환합니다.

EncryptString ( this encryptor, string plainText, EncryptionStringFormat format = EncryptionStringFormat.HexDecimal ) : string

대칭형 암호화 알고리즘을 이용하여 plainText를 암호화하여, format 형태의 문자열로 반환합니다.

GenerateSalt ( int saltLength ) : byte[]

랜덤한 숫자를 만들어낸다. 비밀번호 키를 만들 때 좋다.

GetInitialVector ( int keyLength ) : byte[]

SymmetricAlgorithm 에서 KeySize에 해당하는 Initial Vector를 구한다.

HexToBytes ( this hexString ) : byte[]

16진수 형태의 문자열을 파싱하여 byte 배열을 만든다.

StreamToBytes ( this inStream ) : byte[]

Stream 객체 정보를 읽어서, Byte 배열로 만든다.

StringToBytes ( this content, EncryptionStringFormat format = EncryptionStringFormat.HexDecimal ) : byte[]

지정된 형식의 문자열을 byte 배열로 변환한다.

Method Details

BytesToHex() public static méthode

Byte 배열을 16진수 문자열로 변환한다.
public static BytesToHex ( this bytes ) : string
bytes this
Résultat string

BytesToString() public static méthode

암호화된 Byte 배열을 지정된 형식의 문자열로 변환한다.
public static BytesToString ( this bytes, EncryptionStringFormat format = EncryptionStringFormat.HexDecimal ) : string
bytes this
format EncryptionStringFormat
Résultat string

ClearBuffer() public static méthode

Clear the specified buffer value to 0.
public static ClearBuffer ( this bytes ) : void
bytes this
Résultat void

ComputeHashToBytes() public static méthode

Hash 값을 계산합니다.
public static ComputeHashToBytes ( this hasher, string plainText ) : byte[]
hasher this Hash 알고리즘을 이용하는 암호기
plainText string 원본 문자열
Résultat byte[]

ComputeHashToString() public static méthode

Hash 값을 계산해서, 문자열로 반환합니다.
public static ComputeHashToString ( this hasher, string plainText, EncryptionStringFormat format = EncryptionStringFormat.HexDecimal ) : string
hasher this Hash 알고리즘을 이용하는 암호기
plainText string 원본 문자열
format EncryptionStringFormat 암호화된 정보의 문자열 형식(Base64|HexDecimal)
Résultat string

DecryptBytes() public static méthode

대칭형 암호화 알고르즘을 이용하여 cipherBytes를 복호화 합니다.
public static DecryptBytes ( this encryptor, byte cipherBytes ) : byte[]
encryptor this 대칭형 암호화 인스턴스
cipherBytes byte 암호화된 정보
Résultat byte[]

DecryptString() public static méthode

대칭형 암호화 알고리즘을 이용하여, cipherStream을 복호화한 스트림을 반환합니다.
public static DecryptString ( this encryptor, Stream cipherStream ) : Stream
encryptor this 대칭형 암호화 인스턴스
cipherStream Stream 암호화된 정보를 가진 스트림
Résultat Stream

DecryptString() public static méthode

대칭형 암호화 알고리즘을 이용하여, format형태의 cipherText를 복호화합니다.
public static DecryptString ( this encryptor, string cipherText, EncryptionStringFormat format = EncryptionStringFormat.HexDecimal ) : string
encryptor this 대칭형 암호화 인스턴스
cipherText string 암호화된 정보
format EncryptionStringFormat 암호화된 정보의 문자열 형식(Base64|HexDecimal)
Résultat string

DerivePassword() public static méthode

보통 문자열을 SALT 를 이용해 암호화된 새로운 비밀번호를 만든다.
public static DerivePassword ( string originalPassword, int newPasswordLength ) : byte[]
originalPassword string 원본 문자열
newPasswordLength int 암호화된 새로운 비밀번호의 길이
Résultat byte[]

DerivePasswordAsText() public static méthode

원본 문자열을 SALT 를 이용해 암호화 하여, 원하는 형식의 문자열로 반환한다.
public static DerivePasswordAsText ( string originalPassword, int newPasswordLength, EncryptionStringFormat format = EncryptionStringFormat.HexDecimal ) : string
originalPassword string 원본 문자열
newPasswordLength int 새로운 문자열의 byte stream 크기
format EncryptionStringFormat Base64 or HexaDecimal ContentFormat
Résultat string

EncryptBytes() public static méthode

대칭형 암호화 알고리즘을 이용하여 plainBytes를 암호화 합니다.
public static EncryptBytes ( this encryptor, byte plainBytes ) : byte[]
encryptor this 대칭형 암호화 인스턴스
plainBytes byte 원본 정보
Résultat byte[]

EncryptStream() public static méthode

대칭형 암호화 알고리즘을 이용하여, plainStream을 암호화하여 스트림으로 반환합니다.
public static EncryptStream ( this encryptor, Stream plainStream ) : Stream
encryptor this 대칭형 암호화 인스턴스
plainStream Stream 원본 스트림
Résultat Stream

EncryptString() public static méthode

대칭형 암호화 알고리즘을 이용하여 plainText를 암호화하여, format 형태의 문자열로 반환합니다.
public static EncryptString ( this encryptor, string plainText, EncryptionStringFormat format = EncryptionStringFormat.HexDecimal ) : string
encryptor this 대칭형 암호화 인스턴스
plainText string 원본 문자열
format EncryptionStringFormat 암호화된 정보의 문자열 형식(Base64|HexDecimal)
Résultat string

GenerateSalt() public static méthode

랜덤한 숫자를 만들어낸다. 비밀번호 키를 만들 때 좋다.
public static GenerateSalt ( int saltLength ) : byte[]
saltLength int
Résultat byte[]

GetInitialVector() public static méthode

SymmetricAlgorithm 에서 KeySize에 해당하는 Initial Vector를 구한다.
public static GetInitialVector ( int keyLength ) : byte[]
keyLength int
Résultat byte[]

HexToBytes() public static méthode

16진수 형태의 문자열을 파싱하여 byte 배열을 만든다.
public static HexToBytes ( this hexString ) : byte[]
hexString this
Résultat byte[]

StreamToBytes() public static méthode

Stream 객체 정보를 읽어서, Byte 배열로 만든다.
public static StreamToBytes ( this inStream ) : byte[]
inStream this
Résultat byte[]

StringToBytes() public static méthode

지정된 형식의 문자열을 byte 배열로 변환한다.
public static StringToBytes ( this content, EncryptionStringFormat format = EncryptionStringFormat.HexDecimal ) : byte[]
content this 변환할 문자열
format EncryptionStringFormat 변활할 포맷
Résultat byte[]