Commit d7ec7dc7 authored by Vicente Parra Hurtado's avatar Vicente Parra Hurtado 💬

Alpha 0.2

parents aaba6e98 e71267ca
# Changelog for CrypText
## Alpha 0.2
Corrected bug special character (Data.Text.Encoding)
Creating the application KeyGen with more functions
File crypt -> soon
## Alpha 0.1.3.
Creates 128/256 bytes files automatically (Depending on the length of the text).
......
......@@ -4,7 +4,11 @@ cabal-version: 1.12
--
-- see: https://github.com/sol/hpack
--
<<<<<<< HEAD
-- hash: 561c6a397823960b35f6a93efab2b91411637d7afe0a7514da4c0519bad81a1a
=======
-- hash: e22a32b5a05eab746db788bfba70c4c8ad582e414c038a44d577ecb429a54f91
>>>>>>> Alpha2
name: CrypText
version: 0.1.0.0
......@@ -74,6 +78,26 @@ executable CrypTextGUI-exe
, cryptonite
, random
, text
<<<<<<< HEAD
=======
default-language: Haskell2010
executable KeyGen-exe
main-is: Main.hs
other-modules:
Paths_CrypText
hs-source-dirs:
KeyGen
ghc-options: -threaded -rtsopts -with-rtsopts=-N
build-depends:
CrypText
, base >=4.7 && <5
, base64-bytestring
, bytestring
, cryptonite
, random
, text
>>>>>>> Alpha2
default-language: Haskell2010
test-suite CrypText-test
......
Ph7Pf7BOPx+zPXsfbEp24dEczPeWVSVLnWh+/4hb1kIp9AUEgHhhyIM5UatjWQQ1SJ2osGvOn3VU+gUUOrrThloKf1dhee4wQA4CCUodKFe6Jz45c/uRU3wiKfljqUgA+XbgQFx0i3GePCtU95Z5fqqGxqmn+NgEh8Wqhm+0xEqdqOVrabn2ZdI4Yk/vaCYrfsqQ/2uJ1E0kS5nl4EuGbnlSfQ0g6UcGXSevcrNRkiQFq0CoWQifEqxxmfZl6/Je43IGt980H3jthuVWVm2D6zMYXvRJd4njNVEnCOVPye9niMOkwrpkujxEon6Wj7hQI2LKyqNXCO7gZRhVLL74Uw==
\ No newline at end of file
import NukeBull
import EncrypText
import System.Environment
import Data.Char
import Data.Bits
import Data.Word
import Data.Either
import Data.Maybe
import System.Random
import qualified Data.Text as T
import qualified Data.Text.Encoding as E
import qualified Data.Text.IO as TIO
import Crypto.Cipher.AES (AES256)
import Crypto.Cipher.Types (BlockCipher(..), Cipher(..),IV, makeIV)
import Crypto.Error (throwCryptoError)
import Crypto.Random(getSystemDRG, randomBytesGenerate)
import Crypto.KDF.Scrypt (generate, Parameters(..))
import qualified Data.ByteString as B
import qualified Data.ByteString.Char8 as BC
import qualified Data.ByteString.Base64 as BS
-- Chose 128/256 Block entrophy text
choseBlock :: Int -> Int
choseBlock n
| n < 128 = 128
| n < 256 = 256
main = do
(comando:_) <- getArgs
putStrLn "================================================================="
putStrLn "===== N N U U K K EEEE BBB U U L L ====="
putStrLn "===== NN N U U K K E B B U U L L ====="
putStrLn "===== N N N U U KK EEE BBB U U L L ====="
putStrLn "===== N NN U U K K E B B U U L L ====="
putStrLn "===== N N UUUU K K EEEE BBB UUUU LLLL LLLL ====="
putStrLn "================================================================="
putStrLn ""
putStrLn ""
case comando of
"keyGen" -> do
(_:fileName10:fileName20:_) <- getArgs
let fileName1 = "Keys/" ++ fileName10
-- Read Password = 384 bytes = 16 vectorIV + 32 AES256 + 16 Cipher Lv.3.1 + 64 RandomGen Lv 3.2 + 256 Cipher Lv.3.3
g <- getStdGen
g <- newStdGen
drg <- getSystemDRG
let passwords = randomBytesString 320 g
B.writeFile fileName1 passwords
putStrLn "Creating vectorIV ---- is OK"
putStrLn "Creating AES256 ---- is OK"
putStrLn "Creating Password Lv. 3.1 ---- is OK"
putStrLn "Creating Password Lv. 3.2 ---- is OK"
putStrLn "Creating Password Lv. 3.3 ---- is OK"
putStrLn "Writing File (384 bytes - 3072 bites) ---- is OK"
"encrypt" -> do
(_:fileName10:fileName20:_) <- getArgs
let fileName1 = "Keys/" ++ fileName10
let fileName2 = "CryptMsg/" ++ fileName20
-- Read Password = 384 bytes = 16 vectorIV + 32 AES256 + 16 Cipher Lv.3.1 + 64 RandomGen Lv 3.2 + 256 Cipher Lv.3.3
source <- B.readFile fileName1
let vectorIV = B.pack ( take 16 $ B.unpack source )
let password = B.pack (take 32 ( drop 16 $ B.unpack source ))
let passwordL31 = B.pack (take 16 ( drop 48 $ B.unpack source ))
let rows = passwordRows $ B.unpack passwordL31
let cols = passwordCols $ B.unpack passwordL31
let pass2 = take 64 ( drop 64 $ B.unpack source )
let pass = take 256 ( drop 320 $ B.unpack source )
putStrLn "Reading Passwords (3072 bites) ---- is OK"
-- Text to crypt
putStrLn "Text to Encrypt ( Maximum number of characters: 255 ) (ASCII 217 ┘ Forbidden)"
--line1 <- getLine
textoOn <- TIO.getLine
-- The 217 ASCII is the end of the text ( Point Control)
--let line = line1 ++ [chr(217)]
g <- getStdGen
g <- newStdGen
--- No more 256 bytes
if T.length (textoOn) > 256
then putStrLn $ " Yours Characters are: " ++ (show(T.length (textoOn))) ++" (Number Maximun of characters are 255) "
else do
putStrLn $ " Yours Characters are: " ++ (show(T.length (textoOn))) ++ ". Thanks for used me"
let bock = choseBlock ( T.length (textoOn))
g <- newStdGen
g <- newStdGen
texto <- encryptext g bock password vectorIV (E.encodeUtf8 textoOn)
-- B.writeFile fileName2 texto
if B.length texto == 256
then do
-- One Block
putStrLn "One Block Lv3 ---- is OK"
let textoMatrix = orderLv3 20 (B.unpack texto) rows cols pass pass2
--let textoMatrix = orderBytes 10 (B.unpack texto) rows cols
let base64 = BS.encode textoMatrix
putStrLn "Encrypting Text ---- is Ok"
putStrLn "Encoding Base64 for Humans ---- is Ok"
B.writeFile fileName2 base64
putStrLn "Writing Encrypted-Base64 Text ---- is OK"
else do
-- Two Block
putStrLn "One Block Lv3 ---- is OK"
putStrLn "Two Blocks Lv3 ---- is OK"
let textoMatrix1 = orderLv3 20 (B.unpack (B.take 256 texto)) rows cols pass pass2
let textoMatrix2 = orderLv3 20 (B.unpack (B.drop 256 texto)) rows cols pass pass2
let textoMatrix = B.concat [textoMatrix1 ,textoMatrix2]
let base64 = BS.encode textoMatrix
putStrLn "Encrypting Text ---- is Ok"
putStrLn "Encoding Base64 for Humans ---- is Ok"
B.writeFile fileName2 base64
putStrLn "Writing Encrypted-Base64 Text ---- is OK"
"decrypt" -> do
(_:fileName10:fileName20:_) <- getArgs
let fileName1 = "Keys/" ++ fileName10
let fileName2 = "CryptMsg/" ++ fileName20
-- Read Password = 384 bytes = 16 vectorIV + 32 AES256 + 16 Cipher Lv.3.1 + 64 RandomGen Lv 3.2 + 256 Cipher Lv.3.3
source <- B.readFile fileName1
let vectorIV = B.pack ( take 16 $ B.unpack source )
let password = B.pack (take 32 ( drop 16 $ B.unpack source ))
let passwordL31 = B.pack (take 16 ( drop 48 $ B.unpack source ))
let rows = passwordRows $ B.unpack passwordL31
let cols = passwordCols $ B.unpack passwordL31
let pass2 = take 64 ( drop 64 $ B.unpack source )
let pass = take 256 ( drop 320 $ B.unpack source )
putStrLn "Reading Passwords (3072 bites) ---- is OK"
-- Decrypt
code <- B.readFile fileName2
putStrLn "Reading Encrypted Text ---- is OK"
let base64 = BS.decodeLenient code
putStrLn "Decodig Encrypted Text ---- is OK"
if B.length base64 == 256
then do
-- One Block
putStrLn "One Block Lv3 ---- is OK"
let textoMatrix = orderLv3Inv 20 (B.unpack base64) rows cols pass pass2
let num = div ((BC.length (textoMatrix))-1) 2
let block = choseBlock ( num )
text <- decryptext password vectorIV textoMatrix block
putStrLn "Decrypting Text---- is OK"
putStrLn $ show (B.take 20 text)
-- The 217 ASCII is the end of the text
let textoInt = B.elemIndex 217 text
--putStrLn $ show (B.take (fromJust textoInt) text)
TIO.putStrLn (E.decodeUtf8(B.take (fromJust textoInt) text))
else do
-- Two Block
putStrLn "One Block Lv3 ---- is OK"
putStrLn "Two Blocks Lv3 ---- is OK"
let textoMatrix1 = (orderLv3Inv 20 (B.unpack (B.take 256 base64)) rows cols pass pass2)
let textoMatrix2 = (orderLv3Inv 20 (B.unpack (B.drop 256 base64)) rows cols pass pass2)
let textoMatrix = B.concat [textoMatrix1 ,textoMatrix2]
putStrLn "Decrypting Lv3 ---- is OK"
let num = div ((BC.length (textoMatrix))-1) 2
let block = choseBlock ( num )
text <- decryptext password vectorIV textoMatrix block
putStrLn "Decrypting Text---- is OK"
-- The 217 ASCII is the end of the text
let textoInt = B.elemIndex 217 text
--putStrLn $ show (B.take (fromJust textoInt) text)
TIO.putStrLn (E.decodeUtf8(B.take (fromJust textoInt) text))
otherwise ->do
putStrLn "First Argument Is Not Valid"
putStrLn "Used: keyGen FilePad Name"
putStrLn "Used: encrypt FilePad(Password) FilePad (Output)"
putStrLn "Used: decrypt FilePad(Password) FilePad (Output)"
import NukeBull
import EncrypText
import System.Environment
import Data.Char
import Data.Bits
import Data.Word
import Data.Either
import Data.Maybe
import System.Random
import qualified Data.Text as T
import qualified Data.Text.Encoding as E
import qualified Data.Text.IO as TIO
import Crypto.Cipher.AES (AES256)
import Crypto.Cipher.Types (BlockCipher(..), Cipher(..),IV, makeIV)
import Crypto.Error (throwCryptoError)
import Crypto.Random(getSystemDRG, randomBytesGenerate)
import Crypto.KDF.Scrypt (generate, Parameters(..))
import qualified Data.ByteString as B
import qualified Data.ByteString.Char8 as BC
import qualified Data.ByteString.Base64 as BS
-- Chose 128/256 Block entrophy text
choseBlock :: Int -> Int
choseBlock n
| n < 128 = 128
| n < 256 = 256
main = do
(comando:_) <- getArgs
putStrLn "================================================================="
putStrLn "===== N N U U K K EEEE BBB U U L L ====="
putStrLn "===== NN N U U K K E B B U U L L ====="
putStrLn "===== N N N U U KK EEE BBB U U L L ====="
putStrLn "===== N NN U U K K E B B U U L L ====="
putStrLn "===== N N UUUU K K EEEE BBB UUUU LLLL LLLL ====="
putStrLn "================================================================="
putStrLn ""
putStrLn ""
case comando of
"keyGen" -> do
(_:fileName10:fileName20:_) <- getArgs
let fileName1 = "Keys/" ++ fileName10
-- Read Password = 384 bytes = 16 vectorIV + 32 AES256 + 16 Cipher Lv.3.1 + 64 RandomGen Lv 3.2 + 256 Cipher Lv.3.3
g <- getStdGen
g <- newStdGen
drg <- getSystemDRG
let passwords = randomBytesString 320 g
B.writeFile fileName1 passwords
putStrLn "Creating vectorIV ---- is OK"
putStrLn "Creating AES256 ---- is OK"
putStrLn "Creating Password Lv. 3.1 ---- is OK"
putStrLn "Creating Password Lv. 3.2 ---- is OK"
putStrLn "Creating Password Lv. 3.3 ---- is OK"
putStrLn "Writing File (384 bytes - 3072 bites) ---- is OK"
"encrypt" -> do
(_:fileName10:fileName20:_) <- getArgs
let fileName1 = "Keys/" ++ fileName10
let fileName2 = "CryptMsg/" ++ fileName20
-- Read Password = 384 bytes = 16 vectorIV + 32 AES256 + 16 Cipher Lv.3.1 + 64 RandomGen Lv 3.2 + 256 Cipher Lv.3.3
source <- B.readFile fileName1
let vectorIV = B.pack ( take 16 $ B.unpack source )
let password = B.pack (take 32 ( drop 16 $ B.unpack source ))
let passwordL31 = B.pack (take 16 ( drop 48 $ B.unpack source ))
let rows = passwordRows $ B.unpack passwordL31
let cols = passwordCols $ B.unpack passwordL31
let pass2 = take 64 ( drop 64 $ B.unpack source )
let pass = take 256 ( drop 320 $ B.unpack source )
putStrLn "Reading Passwords (3072 bites) ---- is OK"
-- Text to crypt
putStrLn "Text to Encrypt ( Maximum number of characters: 255 ) (ASCII 217 ┘ Forbidden)"
--line1 <- getLine
textoOn <- TIO.getLine
-- The 217 ASCII is the end of the text ( Point Control)
--let line = line1 ++ [chr(217)]
g <- getStdGen
g <- newStdGen
--- No more 256 bytes
if T.length (textoOn) > 256
then putStrLn $ " Yours Characters are: " ++ (show(T.length (textoOn))) ++" (Number Maximun of characters are 255) "
else do
putStrLn $ " Yours Characters are: " ++ (show(T.length (textoOn))) ++ ". Thanks for used me"
let bock = choseBlock ( T.length (textoOn))
g <- newStdGen
g <- newStdGen
texto <- encryptext g bock password vectorIV (E.encodeUtf8 textoOn)
-- B.writeFile fileName2 texto
if B.length texto == 256
then do
-- One Block
putStrLn "One Block Lv3 ---- is OK"
let textoMatrix = orderLv3 20 (B.unpack texto) rows cols pass pass2
--let textoMatrix = orderBytes 10 (B.unpack texto) rows cols
let base64 = BS.encode textoMatrix
putStrLn "Encrypting Text ---- is Ok"
putStrLn "Encoding Base64 for Humans ---- is Ok"
B.writeFile fileName2 base64
putStrLn "Writing Encrypted-Base64 Text ---- is OK"
else do
-- Two Block
putStrLn "One Block Lv3 ---- is OK"
putStrLn "Two Blocks Lv3 ---- is OK"
let textoMatrix1 = orderLv3 20 (B.unpack (B.take 256 texto)) rows cols pass pass2
let textoMatrix2 = orderLv3 20 (B.unpack (B.drop 256 texto)) rows cols pass pass2
let textoMatrix = B.concat [textoMatrix1 ,textoMatrix2]
let base64 = BS.encode textoMatrix
putStrLn "Encrypting Text ---- is Ok"
putStrLn "Encoding Base64 for Humans ---- is Ok"
B.writeFile fileName2 base64
putStrLn "Writing Encrypted-Base64 Text ---- is OK"
"decrypt" -> do
(_:fileName10:fileName20:_) <- getArgs
let fileName1 = "Keys/" ++ fileName10
let fileName2 = "CryptMsg/" ++ fileName20
-- Read Password = 384 bytes = 16 vectorIV + 32 AES256 + 16 Cipher Lv.3.1 + 64 RandomGen Lv 3.2 + 256 Cipher Lv.3.3
source <- B.readFile fileName1
let vectorIV = B.pack ( take 16 $ B.unpack source )
let password = B.pack (take 32 ( drop 16 $ B.unpack source ))
let passwordL31 = B.pack (take 16 ( drop 48 $ B.unpack source ))
let rows = passwordRows $ B.unpack passwordL31
let cols = passwordCols $ B.unpack passwordL31
let pass2 = take 64 ( drop 64 $ B.unpack source )
let pass = take 256 ( drop 320 $ B.unpack source )
putStrLn "Reading Passwords (3072 bites) ---- is OK"
-- Decrypt
code <- B.readFile fileName2
putStrLn "Reading Encrypted Text ---- is OK"
let base64 = BS.decodeLenient code
putStrLn "Decodig Encrypted Text ---- is OK"
if B.length base64 == 256
then do
-- One Block
putStrLn "One Block Lv3 ---- is OK"
let textoMatrix = orderLv3Inv 20 (B.unpack base64) rows cols pass pass2
let num = div ((BC.length (textoMatrix))-1) 2
let block = choseBlock ( num )
text <- decryptext password vectorIV textoMatrix block
putStrLn "Decrypting Text---- is OK"
putStrLn $ show (B.take 20 text)
-- The 217 ASCII is the end of the text
let textoInt = B.elemIndex 217 text
--putStrLn $ show (B.take (fromJust textoInt) text)
TIO.putStrLn (E.decodeUtf8(B.take (fromJust textoInt) text))
else do
-- Two Block
putStrLn "One Block Lv3 ---- is OK"
putStrLn "Two Blocks Lv3 ---- is OK"
let textoMatrix1 = (orderLv3Inv 20 (B.unpack (B.take 256 base64)) rows cols pass pass2)
let textoMatrix2 = (orderLv3Inv 20 (B.unpack (B.drop 256 base64)) rows cols pass pass2)
let textoMatrix = B.concat [textoMatrix1 ,textoMatrix2]
putStrLn "Decrypting Lv3 ---- is OK"
let num = div ((BC.length (textoMatrix))-1) 2
let block = choseBlock ( num )
text <- decryptext password vectorIV textoMatrix block
putStrLn "Decrypting Text---- is OK"
-- The 217 ASCII is the end of the text
let textoInt = B.elemIndex 217 text
--putStrLn $ show (B.take (fromJust textoInt) text)
TIO.putStrLn (E.decodeUtf8(B.take (fromJust textoInt) text))
otherwise ->do
putStrLn "First Argument Is Not Valid"
putStrLn "Used: keyGen FilePad Name"
putStrLn "Used: encrypt FilePad(Password) FilePad (Output)"
putStrLn "Used: decrypt FilePad(Password) FilePad (Output)"
File added
# RoadMap
1 Cipher 256 bytes
1 Cipher 256 bytes -- OK
2 Wiki implementation
......
<<<<<<< HEAD
import NukeBull (stringtoWord8,word8toString,randomBytesString,passwordRows,passwordCols,orderLv3,orderLv3Inv,encryptAES256,decryptAES256)
=======
import NukeBull
>>>>>>> Alpha2
import EncrypText
import System.Environment
......@@ -9,6 +13,12 @@ import Data.Either
import Data.Maybe
import System.Random
import qualified Data.Text as T
import qualified Data.Text.Encoding as E
import qualified Data.Text.IO as TIO
import Crypto.Cipher.AES (AES256)
import Crypto.Cipher.Types (BlockCipher(..), Cipher(..),IV, makeIV)
import Crypto.Error (throwCryptoError)
......@@ -73,6 +83,7 @@ main = do
-- Text to crypt
putStrLn "Text to Encrypt ( Maximum number of characters: 255 ) (ASCII 217 ┘ Forbidden)"
<<<<<<< HEAD
putStrLn " ñ -> ~ ; áéíóú -> aeiou"
line1 <- getLine
......@@ -93,6 +104,24 @@ main = do
-- Need line <---> ByteString
let lineString = B.pack $ stringtoWord8 line
texto <- encryptext g bock password vectorIV lineString
=======
--line1 <- getLine
textoOn <- TIO.getLine
-- The 217 ASCII is the end of the text ( Point Control)
--let line = line1 ++ [chr(217)]
g <- getStdGen
g <- newStdGen
--- No more 256 bytes
if T.length (textoOn) > 256
then putStrLn $ " Yours Characters are: " ++ (show(T.length (textoOn))) ++" (Number Maximun of characters are 255) "
else do
putStrLn $ " Yours Characters are: " ++ (show(T.length (textoOn))) ++ ". Thanks for used me"
let bock = choseBlock ( T.length (textoOn))
g <- newStdGen
g <- newStdGen
texto <- encryptext g bock password vectorIV (E.encodeUtf8 textoOn)
>>>>>>> Alpha2
-- B.writeFile fileName2 texto
if B.length texto == 256
......@@ -152,9 +181,17 @@ main = do
let block = choseBlock ( num )
text <- decryptext password vectorIV textoMatrix block
putStrLn "Decrypting Text---- is OK"
<<<<<<< HEAD
--The 217 ASCII is the end of the text
let textoInt = B.elemIndex 217 text
putStrLn $ show (word8toString (B.unpack (B.take (fromJust textoInt) text)))
=======
putStrLn $ show (B.take 20 text)
-- The 217 ASCII is the end of the text
let textoInt = B.elemIndex 217 text
--putStrLn $ show (B.take (fromJust textoInt) text)
TIO.putStrLn (E.decodeUtf8(B.take (fromJust textoInt) text))
>>>>>>> Alpha2
else do
-- Two Block
......@@ -171,7 +208,14 @@ main = do
--putStrLn $ show (text)
-- The 217 ASCII is the end of the text
let textoInt = B.elemIndex 217 text
<<<<<<< HEAD
putStrLn $ show (word8toString (B.unpack (B.take (fromJust textoInt) text)))
=======
--putStrLn $ show (B.take (fromJust textoInt) text)
TIO.putStrLn (E.decodeUtf8(B.take (fromJust textoInt) text))
>>>>>>> Alpha2
otherwise ->do
......
......@@ -30,6 +30,7 @@ dependencies:
library:
source-dirs: src
executables:
CrypText-exe:
main: Main.hs
......@@ -51,7 +52,20 @@ executables:
dependencies:
- CrypText
<<<<<<< HEAD
=======
KeyGen-exe:
main: Main.hs
source-dirs: KeyGen
ghc-options:
- -threaded
- -rtsopts
- -with-rtsopts=-N
dependencies:
- CrypText
>>>>>>> Alpha2
......
......@@ -3,23 +3,19 @@ module EncrypText
,decryptext
) where
import RandomGenerator
import LayerAES256
import NukeBull
import System.Random
import Crypto.Cipher.AES (AES256)
import Crypto.Cipher.Types (BlockCipher(..), Cipher(..),IV, makeIV)
import Crypto.Error (throwCryptoError)
import qualified Data.ByteString as B
import qualified Data.ByteString.Char8 as BC
encryptext :: (RandomGen g) => g -> Int -> B.ByteString -> B.ByteString -> String -> IO B.ByteString
encryptext :: (RandomGen g) => g -> Int -> B.ByteString -> B.ByteString -> B.ByteString -> IO B.ByteString
encryptext g num key vector msg = do
let text = entrophyBS num (BC.pack msg) g
let text = entrophyBS num msg g
let mInitIV = makeIV vector
case mInitIV of
Nothing -> error "Failed to generate and initialization vector."
......
module LayerAES256
(encryptAES256
,decryptAES256
) where
import Crypto.Cipher.AES (AES256)
import Crypto.Cipher.Types (BlockCipher(..), Cipher(..),IV, makeIV)
import Crypto.Error (throwCryptoError)
import qualified Data.ByteString as B
encryptAES256 :: B.ByteString -> IV AES256 -> B.ByteString -> B.ByteString
encryptAES256 key cIV plainData = cbcEncrypt ctx cIV plainData
where ctx :: AES256
ctx = throwCryptoError $ cipherInit key
decryptAES256 :: B.ByteString -> IV AES256 -> B.ByteString -> B.ByteString
decryptAES256 key cIV plainData = cbcDecrypt ctx cIV plainData
where ctx :: AES256
ctx = throwCryptoError $ cipherInit key
module RandomGenerator
(deriveKey
module NukeBull
(stringtoWord8
,word8toString
,randomString
,generator
,randomBytes
......@@ -8,6 +9,9 @@ module RandomGenerator
,extendW8
,entrophyBS
,entrophyW8
,encryptAES256
,decryptAES256
,deriveKey
,decryptEntrophy
,passwordRows
,passwordCols
......@@ -19,33 +23,36 @@ import System.Random
import Data.List
import Data.Word
import Data.Bits
import Data.Char
import qualified Data.ByteString as B
import Crypto.Cipher.AES (AES256)
import Crypto.Cipher.Types (BlockCipher(..), Cipher(..),IV, makeIV)
import Crypto.Error (throwCryptoError)
import Crypto.Random(getSystemDRG, randomBytesGenerate)
import Crypto.KDF.Scrypt (generate, Parameters(..))
saltSize = 64
paramN = 64:: Word64
paramR = 8
paramP = 1
paramKeyLen = 256
--Scrypt KDF