Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

bit of code cleanup

  • Loading branch information...
commit 0b436c091596b8f908da6c80b29129a8b4d1c26c 1 parent b3d62b4
Robert Sosinski authored
View
6 README
@@ -5,15 +5,15 @@ project was to allow Ruby programmers interested in cryptography a glimpse of ho
cryptographic algorithm functions in a language they understand.
NOTE: DES is deprecated, and as such, you should not use this implementation in any project you
-plan on developing. I highly recommend the AES, TwoFish or Serpent algorithms through the OpenSSL
+are developing. I highly recommend the AES, TwoFish or Serpent algorithms through the OpenSSL
library instead.
== Running Ruby-DES
Using RubyDES is pretty easy. First, construct a new data and key block.
- data = RubyDES::Block.new('hushhush')
- key = RubyDES::Block.new('password')
+ data = RubyDES::Block.new('mysecret')
+ key = RubyDES::Block.new('hushhush')
Then, build a new <tt>RubyDES::Ctx</tt> object and supply the data and key block.
View
16 test/ctx.yml
@@ -1,11 +1,11 @@
-decrypted_bit_array: [0, 1, 1, 1, 0, 0, 1, 1,
- 0, 1, 1, 0, 0, 1, 0, 1,
- 0, 1, 1, 0, 0, 0, 1, 1,
- 0, 1, 1, 1, 0, 1, 0, 1,
- 0, 1, 1, 1, 0, 0, 1, 0,
- 0, 1, 1, 0, 1, 0, 0, 1,
- 0, 1, 1, 1, 0, 1, 0, 0,
- 0, 1, 1, 1, 1, 0, 0, 1]
+decrypted_bit_array: [0, 1, 1, 1, 0, 0, 1, 1,
+ 0, 1, 1, 0, 0, 1, 0, 1,
+ 0, 1, 1, 0, 0, 0, 1, 1,
+ 0, 1, 1, 1, 0, 1, 0, 1,
+ 0, 1, 1, 1, 0, 0, 1, 0,
+ 0, 1, 1, 0, 1, 0, 0, 1,
+ 0, 1, 1, 1, 0, 1, 0, 0,
+ 0, 1, 1, 1, 1, 0, 0, 1]
encrypted_bit_array: [0, 0, 0, 0, 1, 0, 1, 0,
1, 1, 0, 1, 1, 1, 1, 0,
View
2  test/ctx_test.rb
@@ -17,4 +17,4 @@ def test_run
assert_equal ctx(:decrypted_bit_array), decrypted.bit_array
end
-end
+end
View
2  test/feistel_test.rb
@@ -6,4 +6,4 @@ class FeistelTest < Test::Unit::TestCase
def test_run
assert_equal feistel(:output), Feistel.run(feistel(:half_block), feistel(:sub_key))
end
-end
+end
View
2  test/key_schedule_test.rb
@@ -7,7 +7,7 @@ def setup
@key_schedule = KeySchedule.new(key_schedule(:test_key))
end
- def test_class
+ def test_class
assert_kind_of KeySchedule, @key_schedule
end
View
1  test/test_helper.rb
@@ -17,4 +17,3 @@ def self.fixtures(*list)
end
end
end
-
View
2  test/xor_test.rb
@@ -6,4 +6,4 @@ class XORTest < Test::Unit::TestCase
def test_run
assert_equal xor(:e_xor_sub_key), XOR.run(xor(:e), xor(:sub_key))
end
-end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.