summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--geheim.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/geheim.rb b/geheim.rb
index 40eecbd..ddb5ac5 100644
--- a/geheim.rb
+++ b/geheim.rb
@@ -70,8 +70,12 @@ module Encryption
super()
if @@key.nil?
@@key = File.read($key_file)
- print "IV: "
- input = $stdin.gets.chomp
+ if ENV['IV']
+ input = ENV['IV']
+ else
+ print "IV: "
+ input = $stdin.gets.chomp
+ end
iv = input * 2 + "Hello world" + input * 2
@@iv = iv[0..15]
end