Sha256: b8268c4195ae910977a464b6f54ee6b1f1da78ed0a8c6888caf0e055aa82908c
Contents?: true
Size: 812 Bytes
Versions: 1
Compression:
Stored size: 812 Bytes
Contents
require "base64" module Atlassian module Util module Cryptor def encrypt(plaintext) # encryption_type = "aes-256-cbc" # cipher = OpenSSL::Cipher::Cipher.new(encryption_type) # cipher.encrypt # cipher.iv = iv = cipher.random_iv # encrypted = cipher.update(plaintext) + cipher.final # encrypted = iv + encrypted encrypted = Base64.strict_encode64(plaintext) encrypted end def decrypt(encrypted) # encryption_type = "aes-256-cbc" # cipher = OpenSSL::Cipher::Cipher.new(encryption_type) # cipher.decrypt encrypted = Base64.strict_decode64(encrypted) # cipher.iv = encrypted.slice!(0,cipher.iv_len) # decrypted = cipher.update(encrypted) + cipher.final end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
atlassian-stash-avisi-0.4.15 | lib/atlassian/util/crypt_util.rb |