rcrypto 1.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +4 -0
- metadata +6 -7
- 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: 758d77d1bc29734289b56e6970c14066d4609b4f8212e4e3575f07c0f3e16734
|
4
|
+
data.tar.gz: dca9fd8c4de1999a6f4b02ca969f338a84780f270b9b125c953990500a299623
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 348d2c6373ab7a2e98edaf89a37e80aa64eb9dadf4f43b96ba051903c7cfcb690ba490af3da8ba0e53d7dedb634349c05d5049c9e4dc85b9510635b0acb32338
|
7
|
+
data.tar.gz: 26b8f92173f8949d799e8eff56cc69bb179fc14a5ce5f55010a21687cc5dc5712bcc680ab525dd89c1922a83efd243a3b0398dda1f431e6bb0e396c3d2d4b29f
|
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.1
|
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-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: openssl
|
@@ -119,7 +119,6 @@ files:
|
|
119
119
|
- README.md
|
120
120
|
- lib/RCrypto.rb
|
121
121
|
- lib/RCrypto/decode.rb
|
122
|
-
- lib/RCrypto/encode.rb
|
123
122
|
- lib/RCrypto/version.rb
|
124
123
|
- spec/rcrypto_spec.rb
|
125
124
|
- spec/spec_helper.rb
|
@@ -128,7 +127,7 @@ licenses:
|
|
128
127
|
- MIT
|
129
128
|
metadata:
|
130
129
|
allowed_push_host: https://rubygems.org
|
131
|
-
post_install_message:
|
130
|
+
post_install_message:
|
132
131
|
rdoc_options: []
|
133
132
|
require_paths:
|
134
133
|
- lib
|
@@ -143,8 +142,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
143
142
|
- !ruby/object:Gem::Version
|
144
143
|
version: '0'
|
145
144
|
requirements: []
|
146
|
-
rubygems_version: 3.
|
147
|
-
signing_key:
|
145
|
+
rubygems_version: 3.0.3.1
|
146
|
+
signing_key:
|
148
147
|
specification_version: 4
|
149
148
|
summary: A custom encryption library for Ruby.
|
150
149
|
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
|