cryptopp 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +4 -0
- data/Gemfile +14 -0
- data/Guardfile +17 -0
- data/MIT-LICENSE +1 -1
- data/Rakefile +20 -27
- data/VERSION +1 -0
- data/cryptopp.gemspec +7 -182
- data/ext/Rakefile +2 -2
- data/ext/ciphers.cpp +619 -619
- data/ext/cryptopp.cpp +220 -217
- data/ext/cryptopp_ruby_api.h +7 -7
- data/ext/defs/hashes.def +16 -0
- data/ext/defs/hmacs.def +16 -0
- data/ext/digests.cpp +635 -601
- data/ext/extconf.rb +61 -19
- data/ext/j3way.cpp +5 -5
- data/ext/j3way.h +6 -6
- data/ext/jadler32.h +6 -6
- data/ext/jaes.cpp +5 -5
- data/ext/jaes.h +6 -6
- data/ext/jarc4.cpp +5 -5
- data/ext/jarc4.h +6 -6
- data/ext/jbase.cpp +94 -94
- data/ext/jbase.h +49 -55
- data/ext/jbasiccipherinfo.h +23 -23
- data/ext/jblowfish.cpp +5 -5
- data/ext/jblowfish.h +6 -6
- data/ext/jcamellia.cpp +5 -7
- data/ext/jcamellia.h +6 -8
- data/ext/jcast128.cpp +5 -5
- data/ext/jcast128.h +6 -6
- data/ext/jcast256.cpp +5 -5
- data/ext/jcast256.h +6 -6
- data/ext/jcipher.cpp +62 -62
- data/ext/jcipher.h +24 -24
- data/ext/jcipher_t.h +383 -383
- data/ext/jconfig.h +29 -46
- data/ext/jconstants.h +120 -122
- data/ext/jcrc32.h +6 -6
- data/ext/jdes.cpp +5 -5
- data/ext/jdes.h +6 -6
- data/ext/jdes_ede2.cpp +5 -5
- data/ext/jdes_ede2.h +6 -6
- data/ext/jdes_ede3.cpp +5 -5
- data/ext/jdes_ede3.h +6 -6
- data/ext/jdes_xex3.cpp +5 -5
- data/ext/jdes_xex3.h +6 -6
- data/ext/jdiamond2.cpp +5 -5
- data/ext/jdiamond2.h +6 -6
- data/ext/jdiamond2lite.cpp +5 -5
- data/ext/jdiamond2lite.h +6 -6
- data/ext/jexception.h +5 -5
- data/ext/jgost.cpp +5 -5
- data/ext/jgost.h +6 -6
- data/ext/jhash.cpp +51 -51
- data/ext/jhash.h +22 -27
- data/ext/jhash_t.h +59 -59
- data/ext/jhaval.h +15 -15
- data/ext/jhelpers.cpp +54 -54
- data/ext/jhelpers.h +3 -3
- data/ext/jhmac.cpp +20 -20
- data/ext/jhmac.h +15 -15
- data/ext/jhmac_t.h +40 -72
- data/ext/jidea.cpp +5 -5
- data/ext/jidea.h +6 -6
- data/ext/jmarc4.cpp +5 -5
- data/ext/jmarc4.h +6 -6
- data/ext/jmars.cpp +5 -5
- data/ext/jmars.h +6 -6
- data/ext/jmd2.h +9 -9
- data/ext/jmd4.h +9 -9
- data/ext/jmd5.h +9 -9
- data/ext/jpanamacipher.cpp +7 -7
- data/ext/jpanamacipher.h +9 -9
- data/ext/jpanamahash.h +9 -9
- data/ext/jrc2.cpp +15 -15
- data/ext/jrc2.h +11 -11
- data/ext/jrc5.cpp +5 -5
- data/ext/jrc5.h +6 -6
- data/ext/jrc6.cpp +5 -5
- data/ext/jrc6.h +6 -6
- data/ext/jripemd160.h +28 -28
- data/ext/jsafer.cpp +7 -7
- data/ext/jsafer.h +9 -9
- data/ext/jseal.cpp +7 -7
- data/ext/jseal.h +9 -9
- data/ext/jserpent.cpp +5 -5
- data/ext/jserpent.h +6 -6
- data/ext/jsha.h +38 -37
- data/ext/jsha3.h +130 -0
- data/ext/jsha3_blocksizes.h +73 -0
- data/ext/jshacal2.cpp +5 -5
- data/ext/jshacal2.h +6 -6
- data/ext/jshark.cpp +5 -7
- data/ext/jshark.h +6 -8
- data/ext/jsink.cpp +57 -57
- data/ext/jsink.h +127 -123
- data/ext/jskipjack.cpp +5 -5
- data/ext/jskipjack.h +6 -6
- data/ext/jsquare.cpp +5 -5
- data/ext/jsquare.h +6 -6
- data/ext/jstream.cpp +3 -3
- data/ext/jstream.h +3 -3
- data/ext/jstream_t.h +74 -126
- data/ext/jtea.cpp +5 -5
- data/ext/jtea.h +6 -6
- data/ext/jtiger.h +9 -11
- data/ext/jtwofish.cpp +5 -5
- data/ext/jtwofish.h +6 -6
- data/ext/jwhirlpool.h +9 -11
- data/ext/utils.cpp +3 -3
- data/extras/parser_c.rb +102 -102
- data/test/ciphers_test.rb +24 -30
- data/test/data/ciphers/3desval.yml +13 -0
- data/test/data/ciphers/3wayval.yml +17 -0
- data/test/data/ciphers/arc4.yml +22 -0
- data/test/data/ciphers/blowfish.yml +9 -0
- data/test/data/ciphers/camellia.yml +21 -0
- data/test/data/ciphers/cast128v.yml +13 -0
- data/test/data/ciphers/cast256v.yml +13 -0
- data/test/data/ciphers/descert.yml +723 -0
- data/test/data/ciphers/diamond.yml +31 -0
- data/test/data/ciphers/gostval.yml +33 -0
- data/test/data/ciphers/ideaval.yml +45 -0
- data/test/data/ciphers/marsval.yml +37 -0
- data/test/data/ciphers/panamac.yml +11 -0
- data/test/data/ciphers/rc2val.yml +49 -0
- data/test/data/ciphers/rc5val.yml +26 -0
- data/test/data/ciphers/rc6val.yml +25 -0
- data/test/data/ciphers/rijndael.yml +37 -0
- data/test/data/ciphers/saferval.yml +77 -0
- data/test/data/ciphers/seal.yml +6 -0
- data/test/data/ciphers/serpentv.yml +37 -0
- data/test/data/ciphers/shacal2.yml +21 -0
- data/test/data/ciphers/sharkval.yml +29 -0
- data/test/data/ciphers/skipjack.yml +5 -0
- data/test/data/ciphers/squareva.yml +33 -0
- data/test/data/ciphers/twofishv.yml +37 -0
- data/test/data/digests/adler32.yml +19 -0
- data/test/data/digests/crc32.yml +25 -0
- data/test/data/digests/haval.yml +7 -0
- data/test/data/digests/havalcer.yml +1 -0
- data/test/data/digests/md2.yml +22 -0
- data/test/data/digests/md4.yml +22 -0
- data/test/data/digests/md5.yml +22 -0
- data/test/data/digests/panamah.yml +13 -0
- data/test/data/digests/ripemd.yml +97 -0
- data/test/data/digests/sha.yml +25 -0
- data/test/data/digests/sha3.yml +23 -0
- data/test/data/digests/tiger.yml +30 -0
- data/test/data/digests/whirlpool.yml +25 -0
- data/test/data/hmacs/hmac.yml +14 -0
- data/test/digests_test.rb +17 -23
- data/test/hmacs_test.rb +25 -31
- data/test/test_helper.rb +31 -37
- metadata +70 -82
- data/test/data/ciphers/3desval.dat +0 -7
- data/test/data/ciphers/3wayval.dat +0 -6
- data/test/data/ciphers/arc4.dat +0 -8
- data/test/data/ciphers/blowfish.dat +0 -5
- data/test/data/ciphers/camellia.dat +0 -7
- data/test/data/ciphers/cast128v.dat +0 -5
- data/test/data/ciphers/cast256v.dat +0 -5
- data/test/data/ciphers/descert.dat +0 -198
- data/test/data/ciphers/diamond.dat +0 -9
- data/test/data/ciphers/gostval.dat +0 -10
- data/test/data/ciphers/ideaval.dat +0 -13
- data/test/data/ciphers/marsval.dat +0 -11
- data/test/data/ciphers/panamac.dat +0 -7
- data/test/data/ciphers/rc2val.dat +0 -10
- data/test/data/ciphers/rc5val.dat +0 -7
- data/test/data/ciphers/rc6val.dat +0 -8
- data/test/data/ciphers/rijndael.dat +0 -11
- data/test/data/ciphers/saferval.dat +0 -27
- data/test/data/ciphers/seal.dat +0 -3
- data/test/data/ciphers/serpentv.dat +0 -11
- data/test/data/ciphers/shacal2.dat +0 -7
- data/test/data/ciphers/sharkval.dat +0 -9
- data/test/data/ciphers/skipjack.dat +0 -3
- data/test/data/ciphers/squareva.dat +0 -10
- data/test/data/ciphers/twofishv.dat +0 -11
- data/test/data/digests/adler32.dat +0 -8
- data/test/data/digests/crc32.dat +0 -10
- data/test/data/digests/haval.dat +0 -4
- data/test/data/digests/havalcer.dat +0 -23
- data/test/data/digests/md2.dat +0 -9
- data/test/data/digests/md4.dat +0 -9
- data/test/data/digests/md5.dat +0 -9
- data/test/data/digests/panamah.dat +0 -8
- data/test/data/digests/ripemd.dat +0 -43
- data/test/data/digests/sha.dat +0 -19
- data/test/data/digests/tiger.dat +0 -11
- data/test/data/digests/whirlpool.dat +0 -13
- data/test/data/hmacs/hmac.dat +0 -6
data/ext/jtwofish.cpp
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
|
2
2
|
/*
|
3
|
-
* Copyright (c) 2002-
|
4
|
-
* Crypto++ copyright (c) 1995-
|
5
|
-
* See
|
3
|
+
* Copyright (c) 2002-2014 J Smith <dark.panda@gmail.com>
|
4
|
+
* Crypto++ copyright (c) 1995-2013 Wei Dai
|
5
|
+
* See MIT-LICENSE for the extact license
|
6
6
|
*/
|
7
7
|
|
8
8
|
#include "jtwofish.h"
|
@@ -11,12 +11,12 @@
|
|
11
11
|
|
12
12
|
BlockCipher* JTwofish::getEncryptionObject()
|
13
13
|
{
|
14
|
-
|
14
|
+
return new TwofishEncryption((byte*) itsKey.data(), itsKeylength);
|
15
15
|
}
|
16
16
|
|
17
17
|
BlockCipher* JTwofish::getDecryptionObject()
|
18
18
|
{
|
19
|
-
|
19
|
+
return new TwofishDecryption((byte*) itsKey.data(), itsKeylength);
|
20
20
|
}
|
21
21
|
|
22
22
|
#endif
|
data/ext/jtwofish.h
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
|
2
2
|
/*
|
3
|
-
* Copyright (c) 2002-
|
4
|
-
* Crypto++ copyright (c) 1995-
|
5
|
-
* See
|
3
|
+
* Copyright (c) 2002-2014 J Smith <dark.panda@gmail.com>
|
4
|
+
* Crypto++ copyright (c) 1995-2013 Wei Dai
|
5
|
+
* See MIT-LICENSE for the extact license
|
6
6
|
*/
|
7
7
|
|
8
8
|
#ifndef __JTWOFISH_H__
|
@@ -22,9 +22,9 @@ using namespace CryptoPP;
|
|
22
22
|
|
23
23
|
class JTwofish : public JCipher_Template<Twofish_Info, TWOFISH_CIPHER>
|
24
24
|
{
|
25
|
-
|
26
|
-
|
27
|
-
|
25
|
+
protected:
|
26
|
+
BlockCipher* getEncryptionObject();
|
27
|
+
BlockCipher* getDecryptionObject();
|
28
28
|
};
|
29
29
|
|
30
30
|
#endif
|
data/ext/jwhirlpool.h
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
|
2
2
|
/*
|
3
|
-
* Copyright (c) 2002-
|
4
|
-
* Crypto++ copyright (c) 1995-
|
5
|
-
* See
|
3
|
+
* Copyright (c) 2002-2014 J Smith <dark.panda@gmail.com>
|
4
|
+
* Crypto++ copyright (c) 1995-2013 Wei Dai
|
5
|
+
* See MIT-LICENSE for the extact license
|
6
6
|
*/
|
7
7
|
|
8
8
|
#ifndef __JWHIRLPOOL_H__
|
@@ -10,7 +10,6 @@
|
|
10
10
|
|
11
11
|
#include "jconfig.h"
|
12
12
|
|
13
|
-
#ifdef WORD64_AVAILABLE
|
14
13
|
#if ENABLED_WHIRLPOOL_HASH || ENABLED_WHIRLPOOL_HMAC
|
15
14
|
|
16
15
|
#if ENABLED_WHIRLPOOL_HASH
|
@@ -30,23 +29,22 @@ using namespace CryptoPP;
|
|
30
29
|
#if ENABLED_WHIRLPOOL_HASH
|
31
30
|
class JWhirlpool : public JHash_Template<Whirlpool, WHIRLPOOL_HASH>
|
32
31
|
{
|
33
|
-
|
34
|
-
|
32
|
+
public:
|
33
|
+
JWhirlpool(string plaintext = "") : JHash_Template<Whirlpool, WHIRLPOOL_HASH>(plaintext) { }
|
35
34
|
|
36
|
-
|
35
|
+
static string getHashName() { return "Whirlpool"; }
|
37
36
|
};
|
38
37
|
#endif
|
39
38
|
|
40
39
|
#if ENABLED_WHIRLPOOL_HMAC
|
41
40
|
class JWhirlpool_HMAC : public JHMAC_Template<Whirlpool, WHIRLPOOL_HMAC>
|
42
41
|
{
|
43
|
-
|
44
|
-
|
42
|
+
public:
|
43
|
+
JWhirlpool_HMAC(string plaintext = "") : JHMAC_Template<Whirlpool, WHIRLPOOL_HMAC>(plaintext) { }
|
45
44
|
|
46
|
-
|
45
|
+
static string getHashName() { return "Whirlpool-HMAC"; }
|
47
46
|
};
|
48
47
|
#endif
|
49
48
|
|
50
49
|
#endif
|
51
50
|
#endif
|
52
|
-
#endif
|
data/ext/utils.cpp
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
|
2
2
|
/*
|
3
|
-
* Copyright (c) 2002-
|
4
|
-
* Crypto++ copyright (c) 1995-
|
5
|
-
* See
|
3
|
+
* Copyright (c) 2002-2014 J Smith <dark.panda@gmail.com>
|
4
|
+
* Crypto++ copyright (c) 1995-2013 Wei Dai
|
5
|
+
* See MIT-LICENSE for the extact license
|
6
6
|
*/
|
7
7
|
|
8
8
|
#include "cryptopp_ruby_api.h"
|
data/extras/parser_c.rb
CHANGED
@@ -1,114 +1,114 @@
|
|
1
1
|
|
2
2
|
module RDoc
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
class CustomParser < C_Parser
|
4
|
+
extend ParserFactory
|
5
|
+
parse_files_matching(/\.(?:([CcHh])\1?|c([+xp])\2|y)\z/)
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
7
|
+
def mangle_comment(comment)
|
8
|
+
comment.sub!(%r{/\*+}) { " " * $&.length }
|
9
|
+
comment.sub!(%r{\*+/}) { " " * $&.length }
|
10
|
+
comment.gsub!(/^[ \t]*\*/m, '')
|
11
|
+
comment
|
12
|
+
end
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
14
|
+
private
|
15
|
+
def do_constants
|
16
|
+
@body.scan(
|
17
|
+
%r{
|
18
|
+
CRYPTOPP_DEFINE_CONST\(
|
19
|
+
\s*(\w+)\s*,
|
20
|
+
\s*"([^"]+)"\s*,
|
21
|
+
\s*(\w+)\s*
|
22
|
+
\)\s*;
|
23
|
+
}xm
|
24
|
+
) do |klass, name, definition|
|
25
|
+
handle_constants('const', klass, name, definition)
|
26
|
+
end
|
27
|
+
super
|
28
|
+
end
|
29
29
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
30
|
+
def do_methods
|
31
|
+
@body.scan(
|
32
|
+
%r{
|
33
|
+
CRYPTOPP_MODULE_METHOD\(
|
34
|
+
\s*(\w+)\s*,
|
35
|
+
\s*"([^"]+)"\s*,
|
36
|
+
\s*(\w+)\s*,
|
37
|
+
\s*(-?\w+)\s*
|
38
|
+
\)
|
39
|
+
(?:;\s*/[*/]\s+in\s+(\w+?\.cpp))?
|
40
|
+
}xm
|
41
|
+
) do |mod, name, body, params, source_file|
|
42
|
+
handle_method('module_function', mod, name, body, params, source_file)
|
43
|
+
end
|
44
44
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
45
|
+
@body.scan(
|
46
|
+
%r{
|
47
|
+
CRYPTOPP_CLASS_METHOD\(
|
48
|
+
\s*(\w+)\s*,
|
49
|
+
\s*"([^"]+)"\s*,
|
50
|
+
\s*(\w+)\s*,
|
51
|
+
\s*(-?\w+)\s*
|
52
|
+
\)
|
53
|
+
(?:;\s*/[*/]\s+in\s+(\w+?\.cpp))?
|
54
|
+
}xm
|
55
|
+
) do |klass, name, body, params, source_file|
|
56
|
+
handle_method('method', "rb_cCryptoPP_#{klass}", name, body, params, source_file)
|
57
|
+
end
|
58
58
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
59
|
+
@body.scan(
|
60
|
+
%r{
|
61
|
+
rb_define_(
|
62
|
+
singleton_method |
|
63
|
+
method |
|
64
|
+
module_function |
|
65
|
+
private_method
|
66
|
+
)
|
67
|
+
\s*\(\s*([\w\.]+),
|
68
|
+
\s*"([^"]+)",
|
69
|
+
\s*(?:RUBY_METHOD_FUNC\(|VALUEFUNC\()?(\w+)\)?,
|
70
|
+
\s*(-?\w+)\s*\)
|
71
|
+
(?:;\s*/[*/]\s+in\s+(\w+?\.cpp))?
|
72
|
+
}xm
|
73
|
+
) do |type, var_name, meth_name, meth_body, param_count, source_file|
|
74
|
+
handle_method(type, var_name, meth_name, meth_body, param_count, source_file)
|
75
|
+
end
|
76
|
+
end
|
77
77
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
78
|
+
def do_aliases
|
79
|
+
@body.scan(
|
80
|
+
%r{
|
81
|
+
CRYPTOPP_MODULE_METHOD_ALIAS\(
|
82
|
+
\s*(\w+)\s*,
|
83
|
+
\s*"([^"]+)"\s*,
|
84
|
+
\s*"([^"]+)"\s*
|
85
|
+
\)\s*;
|
86
|
+
}xm
|
87
|
+
) do |mod, new_name, old_name|
|
88
|
+
@stats.num_methods += 1
|
89
|
+
class_name = @known_classes[mod] || mod
|
90
|
+
class_obj = find_class(mod, class_name)
|
91
91
|
|
92
|
-
|
93
|
-
|
92
|
+
class_obj.add_alias(Alias.new("", old_name, new_name, ""))
|
93
|
+
end
|
94
94
|
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
95
|
+
@body.scan(
|
96
|
+
%r{
|
97
|
+
CRYPTOPP_CLASS_METHOD_ALIAS\(
|
98
|
+
\s*(\w+)\s*,
|
99
|
+
\s*"([^"]+)"\s*,
|
100
|
+
\s*"([^"]+)"\s*
|
101
|
+
\)\s*;
|
102
|
+
}xm
|
103
|
+
) do |klass, new_name, old_name|
|
104
|
+
klass = "rb_cCryptoPP_#{klass}"
|
105
|
+
@stats.num_methods += 1
|
106
|
+
class_name = @known_classes[klass] || klass
|
107
|
+
class_obj = find_class(klass, class_name)
|
108
108
|
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
109
|
+
class_obj.add_alias(Alias.new("", old_name, new_name, ""))
|
110
|
+
end
|
111
|
+
super
|
112
|
+
end
|
113
|
+
end
|
114
114
|
end
|
data/test/ciphers_test.rb
CHANGED
@@ -1,37 +1,31 @@
|
|
1
1
|
|
2
|
-
|
3
|
-
require '
|
2
|
+
$: << File.dirname(__FILE__)
|
3
|
+
require 'test_helper'
|
4
4
|
|
5
|
-
class CiphersTest <
|
6
|
-
|
5
|
+
class CiphersTest < MiniTest::Unit::TestCase
|
6
|
+
extend TestHelper
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
Dir.glob('test/data/ciphers/*.yml').sort.each do |f|
|
9
|
+
test_name = File.basename(f).gsub(/.yml$/, '')
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
11
|
+
readfile(f) do |options, i|
|
12
|
+
define_method("test_#{test_name}_#{i}") do
|
13
|
+
if CryptoPP.cipher_enabled? options[:algorithm]
|
14
|
+
encryption_factory_options = options.reject do |k, v|
|
15
|
+
[ :algorithm, :ciphertext, :ciphertext_hex ].include? k
|
16
|
+
end
|
17
|
+
encrypt = CryptoPP.cipher_factory options[:algorithm], encryption_factory_options
|
17
18
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
end
|
24
|
-
encrypt = CryptoPP.cipher_factory options[:algorithm], encryption_factory_options
|
19
|
+
decryption_factory_options = options.reject do |k, v|
|
20
|
+
[ :algorithm, :plaintext, :plaintext_hex ].include? k
|
21
|
+
end
|
22
|
+
decrypt = CryptoPP.cipher_factory options[:algorithm], decryption_factory_options
|
23
|
+
decrypt.decrypt
|
25
24
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
assert_equal(decrypt.plaintext, encrypt.plaintext)
|
33
|
-
assert_equal(decrypt.ciphertext_hex, options[:ciphertext_hex])
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
25
|
+
assert_equal(decrypt.plaintext, encrypt.plaintext)
|
26
|
+
assert_equal(decrypt.ciphertext_hex, options[:ciphertext_hex])
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
37
31
|
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
---
|
2
|
+
- :algorithm: :des_ede2
|
3
|
+
:key_hex: 0123456789abcdeffedcba9876543210
|
4
|
+
:plaintext_hex: 0123456789abcde7
|
5
|
+
:ciphertext_hex: 7f1d0a77826b8aff
|
6
|
+
- :algorithm: :des_ede3
|
7
|
+
:key_hex: 0123456789abcdeffedcba987654321089abcdef01234567
|
8
|
+
:plaintext_hex: 0123456789abcde7
|
9
|
+
:ciphertext_hex: de0b7c06ae5e0ed5
|
10
|
+
- :algorithm: :des_xex3
|
11
|
+
:key_hex: 0123456789abcdef01010101010101011011121314151617
|
12
|
+
:plaintext_hex: 94dbe082549a14ef
|
13
|
+
:ciphertext_hex: '9011121314151617'
|
@@ -0,0 +1,17 @@
|
|
1
|
+
---
|
2
|
+
- :algorithm: :threeway
|
3
|
+
:key_hex: '000000000000000000000000'
|
4
|
+
:plaintext_hex: '000000010000000100000001'
|
5
|
+
:ciphertext_hex: 4059c76e83ae9dc4ad21ecf7
|
6
|
+
- :algorithm: :threeway
|
7
|
+
:key_hex: '000000060000000500000004'
|
8
|
+
:plaintext_hex: '000000030000000200000001'
|
9
|
+
:ciphertext_hex: d2f05b5ed6144138cab920cd
|
10
|
+
- :algorithm: :threeway
|
11
|
+
:key_hex: def01234456789abbcdef012
|
12
|
+
:plaintext_hex: 234567899abcdef001234567
|
13
|
+
:ciphertext_hex: 0aa55dbb9cdddb6d7cdb76b2
|
14
|
+
- :algorithm: :threeway
|
15
|
+
:key_hex: d2f05b5ed6144138cab920cd
|
16
|
+
:plaintext_hex: 4059c76e83ae9dc4ad21ecf7
|
17
|
+
:ciphertext_hex: 478ea8716b13f17c15b155ed
|
@@ -0,0 +1,22 @@
|
|
1
|
+
---
|
2
|
+
- :algorithm: :arc4
|
3
|
+
:key_hex: 0123456789abcdef
|
4
|
+
:plaintext_hex: 0123456789abcdef
|
5
|
+
:ciphertext_hex: 75b7878099e0c596
|
6
|
+
- :algorithm: :arc4
|
7
|
+
:key_hex: 0123456789abcdef
|
8
|
+
:plaintext_hex: '0000000000000000'
|
9
|
+
:ciphertext_hex: 7494c2e7104b0879
|
10
|
+
- :algorithm: :arc4
|
11
|
+
:key_hex: '0000000000000000'
|
12
|
+
:plaintext_hex: '0000000000000000'
|
13
|
+
:ciphertext_hex: de188941a3375d3a
|
14
|
+
- :algorithm: :arc4
|
15
|
+
:key_hex: ef012345
|
16
|
+
:plaintext_hex: '00000000000000000000'
|
17
|
+
:ciphertext_hex: d6a141a7ec3c38dfbd61
|
18
|
+
- :algorithm: :arc4
|
19
|
+
:key_hex: 0123456789abcdef
|
20
|
+
:plaintext_hex: '01'
|
21
|
+
:plaintext_repeat: 512
|
22
|
+
:ciphertext_hex: '7595c3e6114a09780c4ad452338e1ffd9a1be9498f813d76533449b6778dcad8c78a8d2ba9ac66085d0e53d59c26c2d1c490c1ebbe0ce66d1b6b1b13b6b919b847c25a91447a95e75e4ef16779cde8bf0a95850e32af9689444fd377108f98fdcbd4e726567500990bcc7e0ca3c4aaa304a387d20f3b8fbbcd42a1bd311d7a4303dda5ab078896ae80c18b0af66dff319616eb784e495ad2ce90d7f772a81747b65f62093b1e0db9e5ba532fafec47508323e671327df9444432cb7367cec82f5d44c0d00b67d650a075cd4b70dedd77eb9b10231b6b5b741347396d62897421d43df9b42e446e358e9c11a9b2184ecbef0cd8e7a877ef968f1390ec9b3d35a5585cb009290e2fcde7b5ec66d9084be44055a619d9dd7fc3166f9487f7cb272912426445998514c15d53a18c864ce3a2b7555793988126520eacf2e3066e230c91bee4dd5304f5fd0405b35bd99c73135d3d9bc335ee049ef69b3867bf2d7bd1eaa595d8bfc0066ff8d31509eb0c6caa006c807a623ef84c3d33c195d23ee320c40de0558157c822d4b8c569d849aed59d4e0fd7f379586b4b7ff684ed6a189f7486d49b9c4bad9ba24b96abf924372c8a8fffb10d55354900a77a3db5f205e1b99fcd8660863a159ad4abe40fa48934163ddde542a6585540fd683cbfd8c00f12129a284deacc4cdefe58be7137541c047126c8d49e2755ab181ab7e940b0c0'
|