crypto-classical-0.2.1: An educational tool for studying classical cryptography schemes.

Copyright(c) Colin Woodbury 2015 - 2020
LicenseBSD3
MaintainerColin Woodbury <colin@fosskers.ca>
Safe HaskellNone
LanguageHaskell2010

Crypto.Classical.Cipher.Stream

Description

 
Synopsis

Documentation

newtype Stream a Source #

A Cipher with pseudorandom keys as long as the plaintext. Since Haskell is lazy, our keys here are actually of infinite length.

If for whatever reason a key of finite length is given to encrypt, the ciphertext is cutoff to match the key length. Example:

>>> encrypt [1,2,3] "ABCDEF" ^. stream
"BDF"

Constructors

Stream 

Fields

Instances
Monad Stream Source # 
Instance details

Defined in Crypto.Classical.Cipher.Stream

Methods

(>>=) :: Stream a -> (a -> Stream b) -> Stream b #

(>>) :: Stream a -> Stream b -> Stream b #

return :: a -> Stream a #

fail :: String -> Stream a #

Functor Stream Source # 
Instance details

Defined in Crypto.Classical.Cipher.Stream

Methods

fmap :: (a -> b) -> Stream a -> Stream b #

(<$) :: a -> Stream b -> Stream a #

Applicative Stream Source # 
Instance details

Defined in Crypto.Classical.Cipher.Stream

Methods

pure :: a -> Stream a #

(<*>) :: Stream (a -> b) -> Stream a -> Stream b #

liftA2 :: (a -> b -> c) -> Stream a -> Stream b -> Stream c #

(*>) :: Stream a -> Stream b -> Stream b #

(<*) :: Stream a -> Stream b -> Stream a #

Eq a => Eq (Stream a) Source # 
Instance details

Defined in Crypto.Classical.Cipher.Stream

Methods

(==) :: Stream a -> Stream a -> Bool #

(/=) :: Stream a -> Stream a -> Bool #

Show a => Show (Stream a) Source # 
Instance details

Defined in Crypto.Classical.Cipher.Stream

Methods

showsPrec :: Int -> Stream a -> ShowS #

show :: Stream a -> String #

showList :: [Stream a] -> ShowS #

Cipher [ / 26] Stream Source # 
Instance details

Defined in Crypto.Classical.Cipher.Stream

stream :: forall a a. Lens (Stream a) (Stream a) a a Source #