rcrypto 1.0 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -0
- metadata +6 -21
- data/lib/RCrypto/encode.rb +0 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 474280879e7e70f104e7c806a9bd9740671deca7e0baa2303a15c12745e31288
|
4
|
+
data.tar.gz: f690176489717f16e30f13732cfd92a58937f9931033d1a49620995dcffbea36
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94c4d1e82ea600f6285fb850529dd33e4dfc001c206cedcc5089a6fd82c52fabf35caa5a3623540dda8589fc0318969b41be8ffb9b20d2247c1da900eb3a2e80
|
7
|
+
data.tar.gz: 848f7a7426aa1c36f5098d0ef4b08bca8324a6c5ac0139b38ef19d94c1eadf1f7a2e71db32b2a12824dd3d447e64e578a45f8672864b0e27c0757b7fb904abc1
|
data/README.md
CHANGED
@@ -191,3 +191,7 @@ If you encounter any issues or have suggestions for improvements, please feel fr
|
|
191
191
|
- Special thanks to the open-source community for their continuous support.
|
192
192
|
- Inspired by classic encryption techniques and the need for secure communication in Ruby applications.
|
193
193
|
|
194
|
+
# rcrypto
|
195
|
+
# rcrypto
|
196
|
+
# rcrypto
|
197
|
+
# rcrypto
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rcrypto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MAVEN
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-08-
|
11
|
+
date: 2024-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: openssl
|
@@ -52,20 +52,6 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3.0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: securerandom
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '3.0'
|
62
|
-
type: :runtime
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '3.0'
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: bundler
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -119,7 +105,6 @@ files:
|
|
119
105
|
- README.md
|
120
106
|
- lib/RCrypto.rb
|
121
107
|
- lib/RCrypto/decode.rb
|
122
|
-
- lib/RCrypto/encode.rb
|
123
108
|
- lib/RCrypto/version.rb
|
124
109
|
- spec/rcrypto_spec.rb
|
125
110
|
- spec/spec_helper.rb
|
@@ -128,7 +113,7 @@ licenses:
|
|
128
113
|
- MIT
|
129
114
|
metadata:
|
130
115
|
allowed_push_host: https://rubygems.org
|
131
|
-
post_install_message:
|
116
|
+
post_install_message:
|
132
117
|
rdoc_options: []
|
133
118
|
require_paths:
|
134
119
|
- lib
|
@@ -143,8 +128,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
143
128
|
- !ruby/object:Gem::Version
|
144
129
|
version: '0'
|
145
130
|
requirements: []
|
146
|
-
rubygems_version: 3.
|
147
|
-
signing_key:
|
131
|
+
rubygems_version: 3.0.3.1
|
132
|
+
signing_key:
|
148
133
|
specification_version: 4
|
149
134
|
summary: A custom encryption library for Ruby.
|
150
135
|
test_files: []
|
data/lib/RCrypto/encode.rb
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
# lib/RCrypto/encode.rb
|
2
|
-
|
3
|
-
module RCrypto
|
4
|
-
module Encode
|
5
|
-
def self.xor_encrypt(text, key)
|
6
|
-
text.bytes.map.with_index do |byte, i|
|
7
|
-
(byte ^ key.bytes[i % key.length]).chr
|
8
|
-
end.join
|
9
|
-
end
|
10
|
-
|
11
|
-
def self.base64_custom_encode(text)
|
12
|
-
Base64.strict_encode64(text)
|
13
|
-
end
|
14
|
-
|
15
|
-
def self.caesar_cipher_encrypt(text, shift)
|
16
|
-
text.chars.map do |char|
|
17
|
-
if char.match(/[a-zA-Z]/)
|
18
|
-
base = char =~ /[a-z]/ ? 'a'.ord : 'A'.ord
|
19
|
-
((char.ord - base + shift) % 26 + base).chr
|
20
|
-
else
|
21
|
-
char
|
22
|
-
end
|
23
|
-
end.join
|
24
|
-
end
|
25
|
-
|
26
|
-
def self.add_fake_token(text)
|
27
|
-
fake_token = "$" + SecureRandom.alphanumeric(10)
|
28
|
-
insertion_point = SecureRandom.random_number(text.length)
|
29
|
-
text.insert(insertion_point, fake_token)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|