Crate solitaire_cypher

Crate solitaire_cypher 

Source
Expand description

§Solitaire Cypher

An implementation of the playing card based cypher created by Bruce Schneier and featured in Neal Stephenson’s “Cryptonomicon”. Includes crate solitaire_cypher_cli for command line usage. See: https://www.schneier.com/academic/solitaire/ and, of course, read Cryptonomicon!

Structs§

CypherText
Container for an ordered collection of UpperLetters intended for use as cyphertext
KeyStream
Container for an ordered collection of UpperLetters for use as a KeyStream
Passphrase
Container for an ordered collection of UpperLetters intended for use as a passphrase
PlainText
Container for an ordered collection of UpperLetters intended as plaintext

Functions§

decrypt
Decrypt CypherText into PlainText using the given KeyStream
encrypt
Encrypt PlainText into CypherText using the given KeyStream. Will panic if KeyStream length is less than PlainText length rounded up to the nearest multiple of 5.
get_key_stream
Create a KeyStream of the specified length from a Card deck
key_deck_from_passphrase
Create a key deck from a Passphrase (aka key). This follows the basic algorithm in that it does not include the “Optional step”.

Type Aliases§

UpperLetter
Bounded type for ascii uppercase values A-Z