R
Robert Lehman
I'm implementing a version of the "Mini-AES" (http://findarticles.com/
p/articles/mi_qa3926/is_200210/ai_n9129484) in Ruby and have all of
the bit shifts and stuff working..
The problem I'm having is with the file input. When ever the input
file has the character U+001A (http://www.fileformat.info/info/unicode/
char/001a/index.htm), it stops reading in the line (and thus doesn't
complete the whole cipher text).
Basically, here is the code that I'm using to read the input:
fin = File.open(ARGV[0], 'r')
plainText = ""
while (line = fin.gets)
plainText += line
end
fin.close
Here is a sample line of cipher text:
týH†a¤j{ÀìyMšyMÇÜ«àÃSÙ¿àé4þF&käj{Àì
if I read this line in, it would only read "týH†a¤j{ÀìyMšyM" and skip
the rest.
p/articles/mi_qa3926/is_200210/ai_n9129484) in Ruby and have all of
the bit shifts and stuff working..
The problem I'm having is with the file input. When ever the input
file has the character U+001A (http://www.fileformat.info/info/unicode/
char/001a/index.htm), it stops reading in the line (and thus doesn't
complete the whole cipher text).
Basically, here is the code that I'm using to read the input:
fin = File.open(ARGV[0], 'r')
plainText = ""
while (line = fin.gets)
plainText += line
end
fin.close
Here is a sample line of cipher text:
týH†a¤j{ÀìyMšyMÇÜ«àÃSÙ¿àé4þF&käj{Àì
if I read this line in, it would only read "týH†a¤j{ÀìyMšyM" and skip
the rest.