Module: RCrypto::Decode
- Defined in:
- lib/RCrypto/decode.rb
Class Method Summary collapse
- .base64_custom_decode(text) ⇒ Object
- .caesar_cipher_decrypt(text, shift) ⇒ Object
- .remove_fake_token(text) ⇒ Object
- .xor_decrypt(text, key) ⇒ Object
Class Method Details
.base64_custom_decode(text) ⇒ Object
9 10 11 |
# File 'lib/RCrypto/decode.rb', line 9 def self.base64_custom_decode(text) Base64.strict_decode64(text) end |
.caesar_cipher_decrypt(text, shift) ⇒ Object
13 14 15 |
# File 'lib/RCrypto/decode.rb', line 13 def self.caesar_cipher_decrypt(text, shift) RCrypto::Encode.caesar_cipher_encrypt(text, 26 - shift) end |
.remove_fake_token(text) ⇒ Object
17 18 19 |
# File 'lib/RCrypto/decode.rb', line 17 def self.remove_fake_token(text) text.gsub(/\$[a-zA-Z0-9]{10}/, '') end |
.xor_decrypt(text, key) ⇒ Object
5 6 7 |
# File 'lib/RCrypto/decode.rb', line 5 def self.xor_decrypt(text, key) RCrypto::Encode.xor_encrypt(text, key) # XOR encryption is its own inverse end |