Block chaining and string encryption for use with any block cipher.
Crypto.Strings.Types.Key Crypto.Strings.BlockAes.Key
Default key type.
expandKeyString : Crypto.Strings.Types.Config key state randomState -> Crypto.Strings.Types.Passphrase -> Result String (Crypto.Strings.Types.Key key)
Expand a key preparing it for use with encrypt
or decrypt
.
defaultConfig : Crypto.Strings.Types.Config Crypto.Strings.BlockAes.Key Crypto.Strings.Chaining.CtrState randomState
Default configuration.
encrypt : Crypto.Strings.Types.Config key state randomState -> Crypto.Strings.Types.RandomGenerator randomState -> Crypto.Strings.Types.Key key -> Crypto.Strings.Types.Plaintext -> ( Crypto.Strings.Types.Ciphertext, randomState )
Encrypt a string.
decrypt : Crypto.Strings.Types.Config key state randomState -> Crypto.Strings.Types.Key key -> Crypto.Strings.Types.Ciphertext -> Result Crypto.Strings.Types.Plaintext String
Decrypt a string created with encrypt
.
seedGenerator : Random.Seed -> Crypto.Strings.Types.BlockSize -> ( Crypto.Strings.Types.Block, Random.Seed )
A random generator that takes and returns a standard Elm Seed.
listToBlocks : Basics.Int -> List Basics.Int -> List Crypto.Strings.Types.Block
Convert a list of integers into a list of blocks.
The end of the last block will always be #x80 plus zeroes. If all the blocks are full, and the last byte is NOT zero or #x80, then no padding is added.
blocksToList : List Crypto.Strings.Types.Block -> List Basics.Int
Convert a list of blocks into a list of integers.
padLastBlock : Basics.Int -> List Crypto.Strings.Types.Block -> List Crypto.Strings.Types.Block
Put a 0x80 at the end of the last block, and pad with zeroes.
No padding is done if the last block is of the blockSize, and does NOT already end with 0 or 0x80.
unpadLastBlock : List Crypto.Strings.Types.Block -> List Crypto.Strings.Types.Block
Remove the padding added by padLastBlock
from the last block in a list.
stripTrailingZeroes : Crypto.Strings.Types.Block -> Crypto.Strings.Types.Block
Strip the trailing zeroes from a block.