com.phasmidsoftware.tableparser.crypto.Encryption
See theEncryption companion object
Typeclass trait to deal with Encryption for Strings. The encoding of the Strings is dependent on the concrete implementation of this trait.
It is general in nature, but has only been tested with JCA AES128CTR.
Type parameters
- A
-
the cipher algorithm.
Attributes
- Companion
-
object
- Graph
-
- Supertypes
-
class Object
trait Matchable
class Any
- Known subtypes
-
Members list
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]
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].
Generate a random String of the required length.
Generate a random String of the required length.
Attributes
- Returns
-
an IO of String.