BaseHexEncryption
Abstract base class which extends Encryption and provides methods for encrypt/decrypt hex strings.
Type parameters
- A
-
the cipher algorithm.
Attributes
- Graph
-
- Supertypes
- Known subtypes
-
object EncryptionUTF8AES128CTR
Members list
Value members
Concrete methods
Method to check that the given Hex String really does decrypt to the given plaintext.
Method to check that the given Hex String really does decrypt to the given plaintext.
Value parameters
- hex
-
a String of hexadecimals.
- key
-
the secret key.
- plaintext
-
the original plain text.
Attributes
- Returns
-
true if the Hex string is correct.
Given a raw key and a Hex string, do the decryption.
Given a raw key and a Hex string, do the decryption.
Value parameters
- hex
-
a string of Hexadecimal digits representing a cipher.
- rawKey
-
a raw key, i.e. a sequence of 16 characters.
Attributes
- Returns
-
the decrypted String, wrapped in IO.
Given a raw key and a Hex string, do the decryption.
Given a raw key and a Hex string, do the decryption.
Value parameters
- hex
-
a string of Hexadecimal digits representing a cipher.
- rawKey
-
a raw key, i.e. a sequence of 16 characters.
Attributes
- Returns
-
the decrypted String, wrapped in IO.
Encrypt a plain text String but using a randomly generated key. The key, together with the encrypted text as hex and a check boolean, is returned.
Encrypt a plain text String but using a randomly generated key. The key, together with the encrypted text as hex and a check boolean, is returned.
Value parameters
- plaintext
-
the plain text to be encrypted.
Attributes
- Returns
-
a tuple of the raw key, the encrypted cipher (as hex), and a boolean, all wrapped in IO.
Method to get a raw key, wrapped in IO.
Method to get a raw key, wrapped in IO.
NOTE: this way of doing things is slow.
Attributes
- Returns
-
an IO of String.
Inherited and Abstract methods
Build a key from the given String.
Build a key from the given String.
Value parameters
- raw
-
a String of the required length (typically the result of calling genRawKey).
Attributes
- Returns
-
an IO of SecretKey[A]
- Inherited from:
- Encryption
THe inverse of concat.
THe inverse of concat.
Value parameters
- bytes
-
the byte array.
Attributes
- Returns
-
an IO of CipherText[A].
- Inherited from:
- Encryption
Show the given cipher text as a an array of bytes.
Show the given cipher text as a an array of bytes.
Value parameters
- cipher
-
an instance of CipherText[A].
Attributes
- Returns
-
an IO of Array[Byte].
- Inherited from:
- Encryption
Decrypt the given cipher text.
Decrypt the given cipher text.
Value parameters
- cipher
-
an instance of CipherText[A].
- key
-
the key with which to decrypt the cipher text.
Attributes
- Returns
-
an IO of String.
- Inherited from:
- Encryption
Encrypt a plain text String.
Encrypt a plain text String.
Value parameters
- key
-
the key with which to encrypt the plain text.
- plaintext
-
the plain text to encrypt.
Attributes
- Returns
-
an IO of CipherText[A].
- Inherited from:
- Encryption