Commit 8cabcdcb authored by Vicente Parra Hurtado's avatar Vicente Parra Hurtado

Alpha 0.3

parent d20fb97b
OlNGsv1L1DP9ihPgNG2iS61zSpAJv+k2lKTOouAFoo7MR9u34vT+HfurJLa6Y51PLdn7u80rddPWd2DLQvj/anj+DbJV42/t/0VmZu6kSD6RPvmnGanTxVDJVvasC9FlaIaaubyQpLZA37e23vEBiHj3WtMzDADoDIYHwnjL03eyblzUBXCdZbHUqHUp8sLvvWXLzpHi++AQNTn2o41oqVGp9Pgl19FTXYY8W2kLveZnfqaSvkYmxc/xmIo81yKvavnK0EZt0G2bVVckpFlZQUOUNyG0bP/ba2hV/5NncIu6ZAm9kLwu84bYVlGpla3HClIWLBk1rzBA8VmcYM6vog==
\ No newline at end of file
f9VWATasQvOBcR7YeQCUO7qOJUfkVa51tLBAynTYvDhVnPiKuLYZj2ZA55vibVPGjxc6aveqJLPJ0JAuUhcmmMJD7n529untLvv/W6ysBu7ivcUSm+reX7dcqMxMtSj3nPFXjPkxdHPnQbgLN2BpzKbP4NFWEi3Ay4aJUPzYvuaTGi5iSuvVMNOPtFl8n4BXvBBGFrzcKvWL2gGs5a6IoAJjC1puqNs3Q7M/vLnTNSN5O7eAoLKrMHaVjsoU3iqbP0ZepLA5pO4bI9nCHxgX8a6QWPADG1Xd9TynnJoWwNplKJ+v96GVeyOc8+5WDnSGQFUwaa63cLfgS801CGhI0g==
\ No newline at end of file
......@@ -24,18 +24,14 @@ https://www.haskell.org/downloads/#stack
stack build
## 4.a Execute.
## 4.a Generate First Passwords.
stack exec CrypText-exe Argument1 Argument2 Argument3
stack exec KeyGen-exe crazy FirstKey
## 4.b Generate First Passwords.
## 4.b Encrypt First Text.
stack exec CrypText-exe keyGen FirstKey.key SomeThing
stack exec CrypText-exe encrypt FirstKey EncodeFile
## 4.c Encrypt First Text.
## 4.c Decrypt First Text.
stack exec CrypText-exe encrypt FirstKey.key EncodeFile.txt
## 4.d Decrypt First Text.
stack exec CrypText-exe decrypt FirstKey.key EncodeFile.txt
\ No newline at end of file
stack exec CrypText-exe decrypt FirstKey EncodeFile
......@@ -12,7 +12,7 @@ generator :: (RandomGen g ) => Int -> Int -> g -> [Int]
generator n m g = take n $ randomRs (0,m) g
choose :: Int -> B.ByteString -> B.ByteString
choose n b = B.drop 1 (B.take n b )
choose n b = B.drop (n-1) (B.take n b )
ordercrazy :: Int -> [Word8] ->[Int] -> [Int] -> [Word8]
ordercrazy 1 c s1 s2 = noOrder c s1 s2
......@@ -24,7 +24,7 @@ crazyloop n m g = do
let poll = randomBytesString m g
g <- newStdGen
let droping = generator n (m-1) g
let password = B.concat ( map (\x -> B.drop 1 (B.take x poll)) droping )
let password = B.concat ( map (\x -> B.drop x (B.take (x+1) poll)) droping )
return password
......@@ -87,22 +87,19 @@ main = do
g <- newStdGen
let cols = generator 32 15 g
let passworda = B.take 128 (B.pack (ordercrazy 20 passwords rows cols))
let passwordb = B.drop 128 (B.pack (ordercrazy 20 passwords rows cols))
let password = B.pack (B.zipWith (xor) ( passworda) ( passwordb))
let password = B.take 128 (B.pack (ordercrazy 30 passwords rows cols))
let passworda = B.drop 128 (B.pack (ordercrazy 30 passwords rows cols))
let passwordb = B.pack (B.zipWith (xor) ( password) ( passworda))
-- Texting lines
--putStrLn $ show(B.unpack passworda)
--putStrLn $ show(B.unpack passwordb)
--putStrLn $ show(B.unpack password)
B.writeFile fileName1 password
let base64a = BS.encode passworda
let base64b = BS.encode passwordb
let base64 = BS.encode password
B.writeFile fileName1a base64a
B.writeFile fileName1b base64b
B.writeFile fileName1 base64
putStrLn ""
putStrLn ""
putStrLn "================================================================="
......@@ -113,8 +110,8 @@ main = do
putStrLn "===== N N UUUU K K EEEE BBB UUUU LLLL LLLL ====="
putStrLn "================================================================="
putStrLn ""
putStrLn (" Your password has been created in " ++ (show(fileName1)))
putStrLn (" Two Broken keys in " ++ (show(fileName1a)) ++ (show(fileName1a)))
putStrLn (" Your password has been created in " ++ (show(fileName1)))
putStrLn (" Two Complementary keys in " ++ (show(fileName1a)) ++" and "++ (show(fileName1a)))
putStrLn ""
putStrLn ""
......@@ -130,9 +127,26 @@ main = do
let keyb = BS.decodeLenient base64b
let password = B.pack (B.zipWith (xor) ( keya) (keyb))
let base64 = BS.encode password
B.writeFile fileName1 base64
B.writeFile fileName1 password
putStrLn ""
putStrLn ""
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 (" Your password has been created in " ++ (show(fileName1)))
putStrLn ""
"info" -> do
putStrLn "stack exec KeyGen-exe [Argument] FileName (Password) without extension"
putStrLn "Arguments:"
putStrLn "lazy - It is a basic Random Numbers Gen :: stack exec KeyGen-exe lazy FileName"
putStrLn "crazy - It is the Paranoid Random Number Gen :: stack exec KeyGen-exe crazy FileName"
putStrLn "xor - Joins the two complementary passwords :: stack exec KeyGen-exe xor FileName"
otherwise ->do
putStrLn "Arguments Is Not Valid"
......
......@@ -54,7 +54,7 @@ main = do
putStrLn "================================================================="
putStrLn ""
putStrLn ""
putStrLn (" Your text has been encrypted in " ++ (show(fileName2)))
putStrLn (" Your text has been encrypted in " ++ (show(fileName2)))
putStrLn ""
......@@ -90,7 +90,7 @@ main = do
putStrLn "================================================================="
putStrLn ""
putStrLn " Decrypted Text: "
putStr " "
putStrLn ""
TIO.putStrLn (E.decodeUtf8(B.take (fromJust textoInt) text))
putStrLn ""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment