Created
October 5, 2016 06:54
-
-
Save timakin/1cb97f4ea9f1be5d28de9618feeec74c to your computer and use it in GitHub Desktop.
decrypt private key in ruby
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# DECRYPT | |
require 'openssl' | |
require 'base64' | |
private_key_file = 'private.pem'; | |
password = 'boost facile' | |
encrypted_string = %Q{ | |
... | |
} | |
private_key = OpenSSL::PKey::RSA.new(File.read(private_key_file),password) | |
string = private_key.private_decrypt(Base64.decode64(encrypted_string)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment