crypto_toolchain 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +51 -0
  3. data/.rspec +2 -0
  4. data/.travis.yml +5 -0
  5. data/Gemfile +3 -0
  6. data/Guardfile +15 -0
  7. data/LICENSE +21 -0
  8. data/README.md +95 -0
  9. data/Rakefile +6 -0
  10. data/bin/console +14 -0
  11. data/bin/setup +8 -0
  12. data/crypto_toolchain.gemspec +33 -0
  13. data/exe/crypto +7 -0
  14. data/lib/crypto_toolchain/black_boxes/aes_ctr_editor.rb +25 -0
  15. data/lib/crypto_toolchain/black_boxes/cbc_bitflip_target.rb +33 -0
  16. data/lib/crypto_toolchain/black_boxes/cbc_iv_equals_key_target.rb +35 -0
  17. data/lib/crypto_toolchain/black_boxes/cbc_padding_oracle.rb +44 -0
  18. data/lib/crypto_toolchain/black_boxes/ctr_bitflip_target.rb +32 -0
  19. data/lib/crypto_toolchain/black_boxes/dsa_keypair.rb +50 -0
  20. data/lib/crypto_toolchain/black_boxes/ecb_cut_and_paste_target.rb +50 -0
  21. data/lib/crypto_toolchain/black_boxes/ecb_interpolate_chosen_plaintext_oracle.rb +28 -0
  22. data/lib/crypto_toolchain/black_boxes/ecb_or_cbc_encryptor.rb +47 -0
  23. data/lib/crypto_toolchain/black_boxes/ecb_prepend_chosen_plaintext_oracle.rb +23 -0
  24. data/lib/crypto_toolchain/black_boxes/md4_mac.rb +20 -0
  25. data/lib/crypto_toolchain/black_boxes/mt_19937_stream_cipher.rb +47 -0
  26. data/lib/crypto_toolchain/black_boxes/netcat_cbc_padding_oracle.rb +33 -0
  27. data/lib/crypto_toolchain/black_boxes/rsa_keypair.rb +83 -0
  28. data/lib/crypto_toolchain/black_boxes/rsa_parity_oracle.rb +14 -0
  29. data/lib/crypto_toolchain/black_boxes/rsa_unpadded_message_recovery_oracle.rb +24 -0
  30. data/lib/crypto_toolchain/black_boxes/sha1_mac.rb +20 -0
  31. data/lib/crypto_toolchain/black_boxes.rb +22 -0
  32. data/lib/crypto_toolchain/diffie_hellman/messages.rb +53 -0
  33. data/lib/crypto_toolchain/diffie_hellman/mitm.rb +52 -0
  34. data/lib/crypto_toolchain/diffie_hellman/peer.rb +130 -0
  35. data/lib/crypto_toolchain/diffie_hellman/peer_info.rb +43 -0
  36. data/lib/crypto_toolchain/diffie_hellman/received_message.rb +17 -0
  37. data/lib/crypto_toolchain/diffie_hellman.rb +10 -0
  38. data/lib/crypto_toolchain/extensions/integer_extensions.rb +90 -0
  39. data/lib/crypto_toolchain/extensions/object_extensions.rb +24 -0
  40. data/lib/crypto_toolchain/extensions/string_extensions.rb +263 -0
  41. data/lib/crypto_toolchain/extensions.rb +8 -0
  42. data/lib/crypto_toolchain/srp/client.rb +51 -0
  43. data/lib/crypto_toolchain/srp/framework.rb +55 -0
  44. data/lib/crypto_toolchain/srp/server.rb +38 -0
  45. data/lib/crypto_toolchain/srp/simple_client.rb +32 -0
  46. data/lib/crypto_toolchain/srp/simple_server.rb +68 -0
  47. data/lib/crypto_toolchain/srp.rb +14 -0
  48. data/lib/crypto_toolchain/tools/aes_ctr_recoverer.rb +30 -0
  49. data/lib/crypto_toolchain/tools/cbc_bitflip_attack.rb +30 -0
  50. data/lib/crypto_toolchain/tools/cbc_iv_equals_key_attack.rb +30 -0
  51. data/lib/crypto_toolchain/tools/cbc_padding_oracle_attack.rb +51 -0
  52. data/lib/crypto_toolchain/tools/ctr_bitflip_attack.rb +24 -0
  53. data/lib/crypto_toolchain/tools/determine_blocksize.rb +20 -0
  54. data/lib/crypto_toolchain/tools/dsa_recover_nonce_from_signatures.rb +53 -0
  55. data/lib/crypto_toolchain/tools/dsa_recover_private_key_from_nonce.rb +39 -0
  56. data/lib/crypto_toolchain/tools/ecb_cut_and_paste_attack.rb +47 -0
  57. data/lib/crypto_toolchain/tools/ecb_interpolate_chosen_plaintext_attack.rb +72 -0
  58. data/lib/crypto_toolchain/tools/ecb_prepend_chosen_plaintext_attack.rb +42 -0
  59. data/lib/crypto_toolchain/tools/interactive_xor.rb +51 -0
  60. data/lib/crypto_toolchain/tools/low_exponent_rsa_signature_forgery.rb +27 -0
  61. data/lib/crypto_toolchain/tools/md4_length_extension_attack.rb +30 -0
  62. data/lib/crypto_toolchain/tools/mt_19937_seed_recoverer.rb +27 -0
  63. data/lib/crypto_toolchain/tools/mt_19937_stream_cipher_seed_recoverer.rb +40 -0
  64. data/lib/crypto_toolchain/tools/rsa_broadcast_attack.rb +21 -0
  65. data/lib/crypto_toolchain/tools/rsa_parity_oracle_attack.rb +33 -0
  66. data/lib/crypto_toolchain/tools/rsa_unpadded_message_recovery_attack.rb +49 -0
  67. data/lib/crypto_toolchain/tools/sha1_length_extension_attack.rb +30 -0
  68. data/lib/crypto_toolchain/tools.rb +31 -0
  69. data/lib/crypto_toolchain/utilities/hmac.rb +73 -0
  70. data/lib/crypto_toolchain/utilities/md4.rb +106 -0
  71. data/lib/crypto_toolchain/utilities/mt_19937.rb +218 -0
  72. data/lib/crypto_toolchain/utilities/sha1.rb +95 -0
  73. data/lib/crypto_toolchain/utilities.rb +9 -0
  74. data/lib/crypto_toolchain/version.rb +3 -0
  75. data/lib/crypto_toolchain.rb +34 -0
  76. metadata +232 -0
metadata ADDED
@@ -0,0 +1,232 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: crypto_toolchain
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Forrest Fleming
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2017-11-09 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: pry-byebug
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '='
18
+ - !ruby/object:Gem::Version
19
+ version: '3.4'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '='
25
+ - !ruby/object:Gem::Version
26
+ version: '3.4'
27
+ - !ruby/object:Gem::Dependency
28
+ name: openssl
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '2.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '2.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bigdecimal
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.2'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.2'
55
+ - !ruby/object:Gem::Dependency
56
+ name: bundler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.13'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.13'
69
+ - !ruby/object:Gem::Dependency
70
+ name: guard-rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '4.7'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '4.7'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rake
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '10.0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '10.0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rspec
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '3.0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '3.0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: simplecov
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '0.15'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '0.15'
125
+ description: A toolchain for manipulating data in a variety of cryptographic and quasi-cryptographic
126
+ ways.
127
+ email:
128
+ - ffleming@gmail.com
129
+ executables:
130
+ - crypto
131
+ extensions: []
132
+ extra_rdoc_files: []
133
+ files:
134
+ - ".gitignore"
135
+ - ".rspec"
136
+ - ".travis.yml"
137
+ - Gemfile
138
+ - Guardfile
139
+ - LICENSE
140
+ - README.md
141
+ - Rakefile
142
+ - bin/console
143
+ - bin/setup
144
+ - crypto_toolchain.gemspec
145
+ - exe/crypto
146
+ - lib/crypto_toolchain.rb
147
+ - lib/crypto_toolchain/black_boxes.rb
148
+ - lib/crypto_toolchain/black_boxes/aes_ctr_editor.rb
149
+ - lib/crypto_toolchain/black_boxes/cbc_bitflip_target.rb
150
+ - lib/crypto_toolchain/black_boxes/cbc_iv_equals_key_target.rb
151
+ - lib/crypto_toolchain/black_boxes/cbc_padding_oracle.rb
152
+ - lib/crypto_toolchain/black_boxes/ctr_bitflip_target.rb
153
+ - lib/crypto_toolchain/black_boxes/dsa_keypair.rb
154
+ - lib/crypto_toolchain/black_boxes/ecb_cut_and_paste_target.rb
155
+ - lib/crypto_toolchain/black_boxes/ecb_interpolate_chosen_plaintext_oracle.rb
156
+ - lib/crypto_toolchain/black_boxes/ecb_or_cbc_encryptor.rb
157
+ - lib/crypto_toolchain/black_boxes/ecb_prepend_chosen_plaintext_oracle.rb
158
+ - lib/crypto_toolchain/black_boxes/md4_mac.rb
159
+ - lib/crypto_toolchain/black_boxes/mt_19937_stream_cipher.rb
160
+ - lib/crypto_toolchain/black_boxes/netcat_cbc_padding_oracle.rb
161
+ - lib/crypto_toolchain/black_boxes/rsa_keypair.rb
162
+ - lib/crypto_toolchain/black_boxes/rsa_parity_oracle.rb
163
+ - lib/crypto_toolchain/black_boxes/rsa_unpadded_message_recovery_oracle.rb
164
+ - lib/crypto_toolchain/black_boxes/sha1_mac.rb
165
+ - lib/crypto_toolchain/diffie_hellman.rb
166
+ - lib/crypto_toolchain/diffie_hellman/messages.rb
167
+ - lib/crypto_toolchain/diffie_hellman/mitm.rb
168
+ - lib/crypto_toolchain/diffie_hellman/peer.rb
169
+ - lib/crypto_toolchain/diffie_hellman/peer_info.rb
170
+ - lib/crypto_toolchain/diffie_hellman/received_message.rb
171
+ - lib/crypto_toolchain/extensions.rb
172
+ - lib/crypto_toolchain/extensions/integer_extensions.rb
173
+ - lib/crypto_toolchain/extensions/object_extensions.rb
174
+ - lib/crypto_toolchain/extensions/string_extensions.rb
175
+ - lib/crypto_toolchain/srp.rb
176
+ - lib/crypto_toolchain/srp/client.rb
177
+ - lib/crypto_toolchain/srp/framework.rb
178
+ - lib/crypto_toolchain/srp/server.rb
179
+ - lib/crypto_toolchain/srp/simple_client.rb
180
+ - lib/crypto_toolchain/srp/simple_server.rb
181
+ - lib/crypto_toolchain/tools.rb
182
+ - lib/crypto_toolchain/tools/aes_ctr_recoverer.rb
183
+ - lib/crypto_toolchain/tools/cbc_bitflip_attack.rb
184
+ - lib/crypto_toolchain/tools/cbc_iv_equals_key_attack.rb
185
+ - lib/crypto_toolchain/tools/cbc_padding_oracle_attack.rb
186
+ - lib/crypto_toolchain/tools/ctr_bitflip_attack.rb
187
+ - lib/crypto_toolchain/tools/determine_blocksize.rb
188
+ - lib/crypto_toolchain/tools/dsa_recover_nonce_from_signatures.rb
189
+ - lib/crypto_toolchain/tools/dsa_recover_private_key_from_nonce.rb
190
+ - lib/crypto_toolchain/tools/ecb_cut_and_paste_attack.rb
191
+ - lib/crypto_toolchain/tools/ecb_interpolate_chosen_plaintext_attack.rb
192
+ - lib/crypto_toolchain/tools/ecb_prepend_chosen_plaintext_attack.rb
193
+ - lib/crypto_toolchain/tools/interactive_xor.rb
194
+ - lib/crypto_toolchain/tools/low_exponent_rsa_signature_forgery.rb
195
+ - lib/crypto_toolchain/tools/md4_length_extension_attack.rb
196
+ - lib/crypto_toolchain/tools/mt_19937_seed_recoverer.rb
197
+ - lib/crypto_toolchain/tools/mt_19937_stream_cipher_seed_recoverer.rb
198
+ - lib/crypto_toolchain/tools/rsa_broadcast_attack.rb
199
+ - lib/crypto_toolchain/tools/rsa_parity_oracle_attack.rb
200
+ - lib/crypto_toolchain/tools/rsa_unpadded_message_recovery_attack.rb
201
+ - lib/crypto_toolchain/tools/sha1_length_extension_attack.rb
202
+ - lib/crypto_toolchain/utilities.rb
203
+ - lib/crypto_toolchain/utilities/hmac.rb
204
+ - lib/crypto_toolchain/utilities/md4.rb
205
+ - lib/crypto_toolchain/utilities/mt_19937.rb
206
+ - lib/crypto_toolchain/utilities/sha1.rb
207
+ - lib/crypto_toolchain/version.rb
208
+ homepage: https://github.com/ffleming/crypto_toolchain
209
+ licenses:
210
+ - MIT
211
+ metadata: {}
212
+ post_install_message:
213
+ rdoc_options: []
214
+ require_paths:
215
+ - lib
216
+ required_ruby_version: !ruby/object:Gem::Requirement
217
+ requirements:
218
+ - - ">="
219
+ - !ruby/object:Gem::Version
220
+ version: '0'
221
+ required_rubygems_version: !ruby/object:Gem::Requirement
222
+ requirements:
223
+ - - ">="
224
+ - !ruby/object:Gem::Version
225
+ version: '0'
226
+ requirements: []
227
+ rubyforge_project:
228
+ rubygems_version: 2.6.11
229
+ signing_key:
230
+ specification_version: 4
231
+ summary: Crypto toolchain for CTFs and so on
232
+ test_files: []