EncryptionUTF8AES128CTR
An object which provides hex-encryption based on AES128CTR for UTF-8 Strings.
Attributes
- Graph
-
- Supertypes
-
class BaseHexEncryption[AES128CTR]trait HexEncryption[AES128CTR]trait Encryption[AES128CTR]class Objecttrait Matchableclass AnyShow all
- Self type
Members list
Value members
Concrete 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]
THe inverse of concat.
THe inverse of concat.
Value parameters
- bytes
-
the byte array.
Attributes
- Returns
-
an IO of CipherText[A].
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].
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.
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 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.
- Inherited from:
- BaseHexEncryption
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.
- Inherited from:
- BaseHexEncryption
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.
- Inherited from:
- BaseHexEncryption
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.
- Inherited from:
- BaseHexEncryption
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 from:
- BaseHexEncryption