메소드 | 설명 | |
---|---|---|
Decrypt ( this source, byte key, byte iv, CipherStrength strength ) : |
Returns a stream of decrypted data for the given parameters. This returns a memory stream of the decrypted results, if the incoming stream is very large this will consume a large amount of memory. In this case use the overload that takes the destination stream as a parameter instead. |
|
Decrypt ( this source, byte key, byte iv, CipherStrength strength ) : byte[] |
Returns a binary array of decrypted data for the given parameters.
|
|
Decrypt ( this source, int startIndex, int length, byte key, byte iv, CipherStrength strength ) : byte[] |
Returns a binary array of decrypted data for the given parameters.
|
|
Decrypt ( this source, int startIndex, int length, string password, CipherStrength strength ) : byte[] |
Returns a binary array of decrypted data for the given parameters.
|
|
Decrypt ( this source, string password, CipherStrength strength ) : byte[] |
Returns a binary array of decrypted data for the given parameters.
|
|
Decrypt ( this source, string password, CipherStrength strength ) : string |
Returns a decrypted string from a Base64 encoded string of binary encrypted data from the given parameters.
|
|
Decrypt ( this source, Stream destination, byte key, byte iv, CipherStrength strength, Action |
Decrypts input stream onto output stream for the given parameters.
|
|
DecryptFile ( string sourceFileName, string destinationFileName, string password, CipherStrength strength, Action |
Creates a decrypted file from source file data.
|
|
Encrypt ( this source, byte key, byte iv, CipherStrength strength ) : |
Returns a stream of encrypted data for the given parameters. This returns a memory stream of the encrypted results, if the incoming stream is very large this will consume a large amount of memory. In this case use the overload that takes the destination stream as a parameter instead. |
|
Encrypt ( this source, byte key, byte iv, CipherStrength strength ) : byte[] |
Returns a binary array of encrypted data for the given parameters.
|
|
Encrypt ( this source, int startIndex, int length, byte key, byte iv, CipherStrength strength ) : byte[] |
Returns a binary array of encrypted data for the given parameters.
|
|
Encrypt ( this source, int startIndex, int length, string password, CipherStrength strength ) : byte[] |
Returns a binary array of encrypted data for the given parameters.
|
|
Encrypt ( this source, string password, CipherStrength strength ) : byte[] |
Returns a binary array of encrypted data for the given parameters.
|
|
Encrypt ( this source, string password, CipherStrength strength ) : string |
Returns a Base64 encoded string of the returned binary array of the encrypted data, generated with the given parameters.
|
|
Encrypt ( this source, Stream destination, byte key, byte iv, CipherStrength strength, Action |
Encrypts input stream onto output stream for the given parameters.
|
|
EncryptFile ( string sourceFileName, string destinationFileName, string password, CipherStrength strength, Action |
Creates an encrypted file from source file data.
|
|
ExportKeyIV ( string password, int keySize ) : string |
Exports a key and initialization vector from the local system key cache. This method is used to manually export a key to be installed on another computer. |
|
FlushCache ( int millisecondsTimeout = Timeout.Infinite ) : void |
Blocks current thread and waits for any pending save of local system key cache to complete. This method only needs to be used if crypto cache changes could be pending during application shutdown (i.e., executing ciphers with new keys that have not been saved, using existing keys does not queue crypto cache updates) to ensure keys are flushed before exit. For most applications it is expected that this method would be rarely needed. However, possible usage scenarios would include: |
|
GetPasswordHash ( string password, int categoryID ) : string |
Gets the Base64 encoded SHA-256 hash of given user password. The optional categoryID will be appended to the password to allow the same password to be used in different contexts and return different results, when useful. |
|
ImportKeyIV ( string password, int keySize, string keyIVText ) : void |
Imports a key and initialization vector into the local system key cache. This method is used to manually import a key created on another computer. |
|
KeyIVExists ( string password, int keySize ) : bool |
Determines if a key and initialization vector exists for the given password in the local system key cache.
|
|
ReloadCache ( ) : void |
Manually loads keys into the local system key cache.
|
메소드 | 설명 | |
---|---|---|
Cipher ( ) : System |
Static constructor for the Cipher class.
|
public static Decrypt ( this source, byte key, byte iv, CipherStrength strength ) : |
||
source | this | Source stream that contains data to decrypt. |
key | byte | Encryption key to use to decrypt stream. |
iv | byte | Initialization vector to use to decrypt stream. |
strength | CipherStrength | Cryptographic strength to use when decrypting stream. |
리턴 |
public static Decrypt ( this source, byte key, byte iv, CipherStrength strength ) : byte[] | ||
source | this | Binary array of data to decrypt. |
key | byte | Encryption key to use to decrypt data. |
iv | byte | Initialization vector to use to decrypt data. |
strength | CipherStrength | Cryptographic strength to use when decrypting data. |
리턴 | byte[] |
public static Decrypt ( this source, int startIndex, int length, byte key, byte iv, CipherStrength strength ) : byte[] | ||
source | this | Binary array of data to decrypt. |
startIndex | int | Offset into |
length | int | Number of bytes in |
key | byte | Encryption key to use to decrypt data. |
iv | byte | Initialization vector to use to decrypt data. |
strength | CipherStrength | Cryptographic strength to use when decrypting data. |
리턴 | byte[] |
public static Decrypt ( this source, int startIndex, int length, string password, CipherStrength strength ) : byte[] | ||
source | this | Binary array of data to decrypt. |
startIndex | int | Offset into |
length | int | Number of bytes in |
password | string | User password used for key lookup. |
strength | CipherStrength | Cryptographic strength to use when decrypting data. |
리턴 | byte[] |
public static Decrypt ( this source, string password, CipherStrength strength ) : byte[] | ||
source | this | Binary array of data to decrypt. |
password | string | User password used for key lookup. |
strength | CipherStrength | Cryptographic strength to use when decrypting data. |
리턴 | byte[] |
public static Decrypt ( this source, string password, CipherStrength strength ) : string | ||
source | this | Source string to decrypt. |
password | string | User password used for key lookup. |
strength | CipherStrength | Cryptographic strength to use when decrypting string. |
리턴 | string |
public static Decrypt ( this source, Stream destination, byte key, byte iv, CipherStrength strength, Action |
||
source | this | Source stream that contains data to decrypt. |
destination | Stream | Destination stream used to hold decrypted data. |
key | byte | Encryption key to use to decrypt stream. |
iv | byte | Initialization vector to use to decrypt stream. |
strength | CipherStrength | Cryptographic strength to use when decrypting stream. |
progressHandler | Action |
Optional delegate to handle progress updates for decrypting large streams. |
리턴 | void |
public static DecryptFile ( string sourceFileName, string destinationFileName, string password, CipherStrength strength, Action |
||
sourceFileName | string | Source file name. |
destinationFileName | string | Destination file name. |
password | string | User password used for key lookup. |
strength | CipherStrength | Cryptographic strength to use when decrypting file. |
progressHandler | Action |
Optional delegate to handle progress updates for decrypting large files. |
리턴 | void |
public static Encrypt ( this source, byte key, byte iv, CipherStrength strength ) : |
||
source | this | Source stream that contains data to encrypt. |
key | byte | Encryption key to use to encrypt stream. |
iv | byte | Initialization vector to use to encrypt stream. |
strength | CipherStrength | Cryptographic strength to use when encrypting stream. |
리턴 |
public static Encrypt ( this source, byte key, byte iv, CipherStrength strength ) : byte[] | ||
source | this | Binary array of data to encrypt. |
key | byte | Encryption key to use to encrypt data. |
iv | byte | Initialization vector to use to encrypt data. |
strength | CipherStrength | Cryptographic strength to use when encrypting data. |
리턴 | byte[] |
public static Encrypt ( this source, int startIndex, int length, byte key, byte iv, CipherStrength strength ) : byte[] | ||
source | this | Binary array of data to encrypt. |
startIndex | int | Offset into |
length | int | Number of bytes in |
key | byte | Encryption key to use to encrypt data. |
iv | byte | Initialization vector to use to encrypt data. |
strength | CipherStrength | Cryptographic strength to use when encrypting data. |
리턴 | byte[] |
public static Encrypt ( this source, int startIndex, int length, string password, CipherStrength strength ) : byte[] | ||
source | this | Binary array of data to encrypt. |
startIndex | int | Offset into |
length | int | Number of bytes in |
password | string | User password used for key lookup. |
strength | CipherStrength | Cryptographic strength to use when encrypting data. |
리턴 | byte[] |
public static Encrypt ( this source, string password, CipherStrength strength ) : byte[] | ||
source | this | Binary array of data to encrypt. |
password | string | User password used for key lookup. |
strength | CipherStrength | Cryptographic strength to use when encrypting data. |
리턴 | byte[] |
public static Encrypt ( this source, string password, CipherStrength strength ) : string | ||
source | this | Source string to encrypt. |
password | string | User password used for key lookup. |
strength | CipherStrength | Cryptographic strength to use when encrypting string. |
리턴 | string |
public static Encrypt ( this source, Stream destination, byte key, byte iv, CipherStrength strength, Action |
||
source | this | Source stream that contains data to encrypt. |
destination | Stream | Destination stream used to hold encrypted data. |
key | byte | Encryption key to use to encrypt stream. |
iv | byte | Initialization vector to use to encrypt stream. |
strength | CipherStrength | Cryptographic strength to use when encrypting stream. |
progressHandler | Action |
Optional delegate to handle progress updates for encrypting large streams. |
리턴 | void |
public static EncryptFile ( string sourceFileName, string destinationFileName, string password, CipherStrength strength, Action |
||
sourceFileName | string | Source file name. |
destinationFileName | string | Destination file name. |
password | string | User password used for key lookup. |
strength | CipherStrength | Cryptographic strength to use when encrypting file. |
progressHandler | Action |
Optional delegate to handle progress updates for encrypting large files. |
리턴 | void |
public static ExportKeyIV ( string password, int keySize ) : string | ||
password | string | User password used for key lookup. |
keySize | int | Specifies the desired key size. |
리턴 | string |
public static FlushCache ( int millisecondsTimeout = Timeout.Infinite ) : void | ||
millisecondsTimeout | int | The number of milliseconds to wait, or |
리턴 | void |
public static GetPasswordHash ( string password, int categoryID ) : string | ||
password | string | User password to get hash for. |
categoryID | int | Specifies the desired category ID. |
리턴 | string |
public static ImportKeyIV ( string password, int keySize, string keyIVText ) : void | ||
password | string | User password used for key lookups. |
keySize | int | Specifies the desired key size. |
keyIVText | string | Text based key and initialization vector to import into local key cache. |
리턴 | void |
public static KeyIVExists ( string password, int keySize ) : bool | ||
password | string | User password used for key lookups. |
keySize | int | Specifies the desired key size. |
리턴 | bool |