summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@mimecast.com>2018-05-27 22:10:38 +0100
committerPaul Buetow <paul@mimecast.com>2018-05-27 22:10:38 +0100
commitd8df43f387eaec2cb1d24e0abef87b8464e528c5 (patch)
tree65b38a750c825f37e371a4bd51975011849becb4
parent2ae97604c1a8e4afcf9b84b19a2c87b8bf058a6e (diff)
ensure iv is 16b
-rw-r--r--geheim.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/geheim.rb b/geheim.rb
index f7afb7e..40eecbd 100644
--- a/geheim.rb
+++ b/geheim.rb
@@ -71,7 +71,9 @@ module Encryption
if @@key.nil?
@@key = File.read($key_file)
print "IV: "
- @@iv = @@key[-1] + $stdin.gets.chomp * 10 + @@key[0]
+ input = $stdin.gets.chomp
+ iv = input * 2 + "Hello world" + input * 2
+ @@iv = iv[0..15]
end
end