app.rb
# decrypt a string using a pre-defined encryption key
decrypt a string using a pre-defined encryption key
decrypt a string using a pre - defined encryption key
def decrypt(encrypted_secret,encryption_key)
    decipher = OpenSSL::Cipher::AES256.new :CFB
    decipher.decrypt
    decipher.iv = Base64.decode64(encrypted_secret['iv'])
    decipher.key = encryption_key
    decrypted_secret = Base64.decode64(decipher.update(Base64.decode64(encrypted_secret['params'])) + decipher.final)
    return decrypted_secret
  end
def decrypt ( encrypted_secret , encryption_key ) decipher = OpenSSL :: Cipher :: AES256 . new :CFB decipher . decrypt decipher . iv = Base64 . decode64 ( encrypted_secret [ 'iv' ] ) decipher . key = encryption_key decrypted_secret = Base64 . decode64 ( decipher . update ( Base64 . decode64 ( encrypted_secret [ 'params' ] ) ) + decipher . final ) return decrypted_secret end
decrypt a string using a pre-defined encryption key
decrypt a string using a pre - defined encryption key
# initialize new cipher object # use the base64 decoded IV which was fetched from the redis secret # set the predefined encryption_key as the decipher.key # decrypt and decode the secret # pass the plaintext data back to the application
encrypted_secret
<not_specific>
encryption_key
<not_specific>