Skip to content

Instantly share code, notes, and snippets.

Created May 31, 2016 07:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/7c85e8f8bd63c1651d5d7c46361cf2f5 to your computer and use it in GitHub Desktop.
Save anonymous/7c85e8f8bd63c1651d5d7c46361cf2f5 to your computer and use it in GitHub Desktop.
if choice == "Encrypt"
output = ""
File.open('Ruby_Plaintext.txt', 'r') do |text|
read_in = text.read.split(" ")
read_in.each do |plaintext|
ciphertext = encrypt(plaintext, key)
output += ciphertext + " "
end
end
File.open('Ruby_Ciphertext.txt', 'w') { |file| file.write(output) }
passed = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment