Сохранения зашифрованного текста в файл
This commit is contained in:
@@ -22,6 +22,7 @@ main = do
|
||||
|
||||
let sourceTextPath = "resources/biography.txt"
|
||||
let sourceImagePath = "resources/david.bmp"
|
||||
let encryptedTextPath = "tmp/biography_encrypted.txt"
|
||||
let encodedImagePath = "tmp/david_" ++ show bitsPerByte ++ "_" ++ show caesarShift ++ ".bmp"
|
||||
let decodedTextPath = "tmp/biography.txt"
|
||||
|
||||
@@ -34,6 +35,8 @@ main = do
|
||||
putStrLn $ "Размер алфавита: " ++ show (length alphabet)
|
||||
let encryptedText = encryptCaesar alphabet caesarShift inputText
|
||||
putStrLn $ "10 символов шифра: \"" ++ take 10 encryptedText ++ "\""
|
||||
writeFile encryptedTextPath encryptedText
|
||||
putStrLn $ "Зашифрованный текст сохранён в файл \"" ++ encryptedTextPath ++ "\""
|
||||
let encryptedTextBits = textToBits encryptedText
|
||||
putStrLn $ "10 битов шифра: \"" ++ show (take 10 $ VU.toList encryptedTextBits) ++ "\""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user