ccipher_factory 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +7 -0
  2. data/.rspec +3 -0
  3. data/Gemfile +30 -0
  4. data/Gemfile.lock-java +65 -0
  5. data/Gemfile.lock-ruby +67 -0
  6. data/README.md +80 -0
  7. data/Rakefile +10 -0
  8. data/bin/console +15 -0
  9. data/bin/setup +8 -0
  10. data/ccipher_factory.gemspec +46 -0
  11. data/lib/ccipher_factory/asymkey/asymkey.rb +16 -0
  12. data/lib/ccipher_factory/asymkey/asymkey_generator.rb +87 -0
  13. data/lib/ccipher_factory/asymkey/ecc_keypair.rb +56 -0
  14. data/lib/ccipher_factory/asymkey_cipher/asymkey_cipher.rb +63 -0
  15. data/lib/ccipher_factory/asymkey_cipher/asymkey_signer.rb +44 -0
  16. data/lib/ccipher_factory/asymkey_cipher/ecc/ecc_att_decrypt.rb +55 -0
  17. data/lib/ccipher_factory/asymkey_cipher/ecc/ecc_att_encrypt.rb +70 -0
  18. data/lib/ccipher_factory/asymkey_cipher/ecc/ecc_att_signer.rb +88 -0
  19. data/lib/ccipher_factory/asymkey_cipher/ecc/ecc_att_verifier.rb +100 -0
  20. data/lib/ccipher_factory/asymkey_cipher/ecc/ecc_decrypt.rb +80 -0
  21. data/lib/ccipher_factory/asymkey_cipher/ecc/ecc_encrypt.rb +101 -0
  22. data/lib/ccipher_factory/asymkey_cipher/ecc/ecc_signer.rb +80 -0
  23. data/lib/ccipher_factory/asymkey_cipher/ecc/ecc_verifier.rb +56 -0
  24. data/lib/ccipher_factory/composite_cipher/composite_cipher.rb +28 -0
  25. data/lib/ccipher_factory/composite_cipher/decrypt_verifier.rb +116 -0
  26. data/lib/ccipher_factory/composite_cipher/sign_encryptor.rb +100 -0
  27. data/lib/ccipher_factory/compression/compression_helper.rb +103 -0
  28. data/lib/ccipher_factory/compression/compressor.rb +55 -0
  29. data/lib/ccipher_factory/compression/zlib_compressor.rb +48 -0
  30. data/lib/ccipher_factory/compression/zlib_decompressor.rb +67 -0
  31. data/lib/ccipher_factory/digest/digest.rb +180 -0
  32. data/lib/ccipher_factory/digest/supported_digest.rb +47 -0
  33. data/lib/ccipher_factory/encoding/asn1.rb +43 -0
  34. data/lib/ccipher_factory/encoding/bin_struct.rb +207 -0
  35. data/lib/ccipher_factory/encoding/binenc_constant.rb +149 -0
  36. data/lib/ccipher_factory/helpers/common.rb +124 -0
  37. data/lib/ccipher_factory/kcv/kcv.rb +89 -0
  38. data/lib/ccipher_factory/kdf/hkdf.rb +114 -0
  39. data/lib/ccipher_factory/kdf/kdf.rb +73 -0
  40. data/lib/ccipher_factory/kdf/pbkdf2.rb +82 -0
  41. data/lib/ccipher_factory/kdf/scrypt.rb +105 -0
  42. data/lib/ccipher_factory/shamir/shamir_sharing.rb +293 -0
  43. data/lib/ccipher_factory/shamir/shamir_sharing_helper.rb +88 -0
  44. data/lib/ccipher_factory/symkey/derived_symkey.rb +110 -0
  45. data/lib/ccipher_factory/symkey/hardware_symkey.rb +0 -0
  46. data/lib/ccipher_factory/symkey/soft_symkey.rb +63 -0
  47. data/lib/ccipher_factory/symkey/symkey.rb +122 -0
  48. data/lib/ccipher_factory/symkey/symkey_generator.rb +70 -0
  49. data/lib/ccipher_factory/symkey_cipher/symkey_att_decrypt.rb +64 -0
  50. data/lib/ccipher_factory/symkey_cipher/symkey_att_encrypt.rb +65 -0
  51. data/lib/ccipher_factory/symkey_cipher/symkey_att_sign.rb +84 -0
  52. data/lib/ccipher_factory/symkey_cipher/symkey_att_verify.rb +85 -0
  53. data/lib/ccipher_factory/symkey_cipher/symkey_cipher.rb +101 -0
  54. data/lib/ccipher_factory/symkey_cipher/symkey_decrypt.rb +144 -0
  55. data/lib/ccipher_factory/symkey_cipher/symkey_encrypt.rb +164 -0
  56. data/lib/ccipher_factory/symkey_cipher/symkey_sign.rb +70 -0
  57. data/lib/ccipher_factory/symkey_cipher/symkey_signer.rb +59 -0
  58. data/lib/ccipher_factory/symkey_cipher/symkey_verify.rb +76 -0
  59. data/lib/ccipher_factory/version.rb +5 -0
  60. data/lib/ccipher_factory.rb +52 -0
  61. data/run_test.rb +27 -0
  62. metadata +172 -0
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "ccipher_factory/version"
4
+
5
+ #require 'tlogger'
6
+ require 'teLogger'
7
+ require 'toolrack'
8
+
9
+ include TeLogger
10
+
11
+ require 'ccrypto'
12
+ require 'binenc'
13
+ if TR::RTUtils.on_jruby?
14
+ require 'ccrypto/java'
15
+ require 'binenc/java'
16
+ else
17
+ require 'ccrypto/ruby'
18
+ require 'binenc/ruby'
19
+ end
20
+
21
+ require_relative 'ccipher_factory/encoding/binenc_constant'
22
+ require_relative 'ccipher_factory/encoding/bin_struct'
23
+
24
+ require_relative 'ccipher_factory/encoding/asn1'
25
+
26
+ require_relative 'ccipher_factory/helpers/common'
27
+
28
+ require_relative 'ccipher_factory/digest/supported_digest'
29
+ require_relative 'ccipher_factory/digest/digest'
30
+ require_relative 'ccipher_factory/compression/compressor'
31
+ require_relative 'ccipher_factory/kcv/kcv'
32
+
33
+ require_relative 'ccipher_factory/symkey/symkey_generator'
34
+ require_relative 'ccipher_factory/symkey_cipher/symkey_cipher'
35
+ require_relative 'ccipher_factory/symkey_cipher/symkey_signer'
36
+
37
+ require_relative 'ccipher_factory/asymkey/asymkey_generator'
38
+ require_relative 'ccipher_factory/asymkey_cipher/asymkey_cipher'
39
+ require_relative 'ccipher_factory/asymkey_cipher/asymkey_signer'
40
+
41
+ require_relative 'ccipher_factory/composite_cipher/composite_cipher'
42
+
43
+ module CcipherFactory
44
+ class Error < StandardError; end
45
+ # Your code goes here...
46
+ class SymKeyCipherError < StandardError; end
47
+ class SymKeyDecryptionError < StandardError; end
48
+
49
+ end
50
+
51
+ MemBuf = Ccrypto::UtilFactory.instance(:membuf)
52
+
data/run_test.rb ADDED
@@ -0,0 +1,27 @@
1
+
2
+
3
+ require 'toolrack'
4
+ require 'fileutils'
5
+
6
+ gemfile = File.join(File.dirname(__FILE__),"Gemfile.lock")
7
+ if TR::RTUtils.on_jruby?
8
+ rtGemFile = File.join(File.dirname(__FILE__),"Gemfile.lock-java")
9
+ else
10
+ rtGemFile = File.join(File.dirname(__FILE__),"Gemfile.lock-ruby")
11
+ end
12
+
13
+ if File.exist?(rtGemFile)
14
+
15
+ FileUtils.rm_f gemfile if File.exist?(gemfile)
16
+
17
+ FileUtils.cp rtGemFile, gemfile
18
+
19
+ cmd = "bundle exec rspec #{ARGV.join(" ")}"
20
+
21
+ system(cmd)
22
+
23
+ else
24
+
25
+ STDERR.puts "No java or ruby Gemfile.lock found. Please create the environment first."
26
+
27
+ end
metadata ADDED
@@ -0,0 +1,172 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ccipher_factory
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Ian
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2022-08-11 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: toolrack
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: teLogger
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: ccrypto
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: binenc
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: devops_assist
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ description: ''
84
+ email:
85
+ - cameronian0@protonmail.com
86
+ executables: []
87
+ extensions: []
88
+ extra_rdoc_files: []
89
+ files:
90
+ - ".rspec"
91
+ - Gemfile
92
+ - Gemfile.lock-java
93
+ - Gemfile.lock-ruby
94
+ - README.md
95
+ - Rakefile
96
+ - bin/console
97
+ - bin/setup
98
+ - ccipher_factory.gemspec
99
+ - lib/ccipher_factory.rb
100
+ - lib/ccipher_factory/asymkey/asymkey.rb
101
+ - lib/ccipher_factory/asymkey/asymkey_generator.rb
102
+ - lib/ccipher_factory/asymkey/ecc_keypair.rb
103
+ - lib/ccipher_factory/asymkey_cipher/asymkey_cipher.rb
104
+ - lib/ccipher_factory/asymkey_cipher/asymkey_signer.rb
105
+ - lib/ccipher_factory/asymkey_cipher/ecc/ecc_att_decrypt.rb
106
+ - lib/ccipher_factory/asymkey_cipher/ecc/ecc_att_encrypt.rb
107
+ - lib/ccipher_factory/asymkey_cipher/ecc/ecc_att_signer.rb
108
+ - lib/ccipher_factory/asymkey_cipher/ecc/ecc_att_verifier.rb
109
+ - lib/ccipher_factory/asymkey_cipher/ecc/ecc_decrypt.rb
110
+ - lib/ccipher_factory/asymkey_cipher/ecc/ecc_encrypt.rb
111
+ - lib/ccipher_factory/asymkey_cipher/ecc/ecc_signer.rb
112
+ - lib/ccipher_factory/asymkey_cipher/ecc/ecc_verifier.rb
113
+ - lib/ccipher_factory/composite_cipher/composite_cipher.rb
114
+ - lib/ccipher_factory/composite_cipher/decrypt_verifier.rb
115
+ - lib/ccipher_factory/composite_cipher/sign_encryptor.rb
116
+ - lib/ccipher_factory/compression/compression_helper.rb
117
+ - lib/ccipher_factory/compression/compressor.rb
118
+ - lib/ccipher_factory/compression/zlib_compressor.rb
119
+ - lib/ccipher_factory/compression/zlib_decompressor.rb
120
+ - lib/ccipher_factory/digest/digest.rb
121
+ - lib/ccipher_factory/digest/supported_digest.rb
122
+ - lib/ccipher_factory/encoding/asn1.rb
123
+ - lib/ccipher_factory/encoding/bin_struct.rb
124
+ - lib/ccipher_factory/encoding/binenc_constant.rb
125
+ - lib/ccipher_factory/helpers/common.rb
126
+ - lib/ccipher_factory/kcv/kcv.rb
127
+ - lib/ccipher_factory/kdf/hkdf.rb
128
+ - lib/ccipher_factory/kdf/kdf.rb
129
+ - lib/ccipher_factory/kdf/pbkdf2.rb
130
+ - lib/ccipher_factory/kdf/scrypt.rb
131
+ - lib/ccipher_factory/shamir/shamir_sharing.rb
132
+ - lib/ccipher_factory/shamir/shamir_sharing_helper.rb
133
+ - lib/ccipher_factory/symkey/derived_symkey.rb
134
+ - lib/ccipher_factory/symkey/hardware_symkey.rb
135
+ - lib/ccipher_factory/symkey/soft_symkey.rb
136
+ - lib/ccipher_factory/symkey/symkey.rb
137
+ - lib/ccipher_factory/symkey/symkey_generator.rb
138
+ - lib/ccipher_factory/symkey_cipher/symkey_att_decrypt.rb
139
+ - lib/ccipher_factory/symkey_cipher/symkey_att_encrypt.rb
140
+ - lib/ccipher_factory/symkey_cipher/symkey_att_sign.rb
141
+ - lib/ccipher_factory/symkey_cipher/symkey_att_verify.rb
142
+ - lib/ccipher_factory/symkey_cipher/symkey_cipher.rb
143
+ - lib/ccipher_factory/symkey_cipher/symkey_decrypt.rb
144
+ - lib/ccipher_factory/symkey_cipher/symkey_encrypt.rb
145
+ - lib/ccipher_factory/symkey_cipher/symkey_sign.rb
146
+ - lib/ccipher_factory/symkey_cipher/symkey_signer.rb
147
+ - lib/ccipher_factory/symkey_cipher/symkey_verify.rb
148
+ - lib/ccipher_factory/version.rb
149
+ - run_test.rb
150
+ homepage: https://github.com/cameronian/ccipher_factory
151
+ licenses: []
152
+ metadata: {}
153
+ post_install_message:
154
+ rdoc_options: []
155
+ require_paths:
156
+ - lib
157
+ required_ruby_version: !ruby/object:Gem::Requirement
158
+ requirements:
159
+ - - ">="
160
+ - !ruby/object:Gem::Version
161
+ version: 2.4.0
162
+ required_rubygems_version: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ requirements: []
168
+ rubygems_version: 3.2.22
169
+ signing_key:
170
+ specification_version: 4
171
+ summary: ''
172
+ test_files: []