Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

adding TEST_KEY

  • Loading branch information...
commit 05cc7d068aa98224963611e47518a56ad8b7913f 1 parent a6a0a78
Robert Sosinski authored
View
20 lib/ruby-des.rb
@@ -22,7 +22,27 @@ module RubyDES
0x22, 0x02, 0x2a, 0x0a, 0x32, 0x12, 0x3a, 0x1a,
0x21, 0x01, 0x29, 0x09, 0x31, 0x11, 0x39, 0x19]
+ # The binary representation of "ruby-des" with proper parity."
+ TEST_KEY = ["1", "1", "1", "0", "0", "1", "0", "1",
+ "1", "1", "1", "0", "1", "0", "1", "0",
+ "1", "1", "0", "0", "0", "1", "0", "0",
+ "1", "1", "1", "1", "0", "0", "1", "0",
+ "0", "1", "0", "1", "1", "0", "1", "1",
+ "1", "1", "0", "0", "1", "0", "0", "0",
+ "1", "1", "0", "0", "1", "0", "1", "1",
+ "1", "1", "1", "0", "0", "1", "1", "0"]
+
class Ctx
+ def self.new(block, key)
+
+ end
+
+ def encrypt
+
+ end
+ def decrypt
+
+ end
end
end
View
6 lib/ruby-des/feistel.rb
@@ -57,5 +57,11 @@ class Feistel
0x07, 0x0b, 0x04, 0x01, 0x09, 0x0c, 0x0e, 0x02, 0x00, 0x06, 0x0a, 0x0d, 0x0f, 0x03, 0x05, 0x08,
0x02, 0x01, 0x0e, 0x07, 0x04, 0x0a, 0x08, 0x0d, 0x0f, 0x0c, 0x09, 0x00, 0x03, 0x05, 0x06, 0x0b]
+ def self.new(half_block, sub_key, round)
+
+ end
+ def run
+
+ end
end
View
8 lib/ruby-des/key_schedule.rb
@@ -9,6 +9,8 @@ class KeySchedule
0x0e, 0x06, 0x3d, 0x35, 0x2d, 0x25, 0x1d,
0x15, 0x0d, 0x05, 0x1c, 0x14, 0x0c, 0x04]
+ PC_1 = PC_1_L + PC_1_R
+
PC_2 = [0x0e, 0x11, 0x0b, 0x18, 0x01, 0x05,
0x03, 0x1c, 0x0f, 0x06, 0x15, 0x0a,
0x17, 0x13, 0x0c, 0x04, 0x1a, 0x08,
@@ -21,5 +23,9 @@ class KeySchedule
ROTATIONS = [1, 1, 2, 2, 2, 2, 2, 2,
1, 2, 2, 2, 2, 2, 2, 1]
-
+ def self.create(key)
+
+
+ return sub_keys
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.