RUBI ON RAILS
Código Rubi on rails:
Ver original
require 'openssl' file_path_key = "data.bin1" file_path_key_ = "wrapped.bin1" private_key_file = "private.key"; wrapped = File.read(file_path_key_) cipher_text = File.read(file_path_key) privkey = OpenSSL::PKey::RSA.new(File.read(private_key_file)) #p privkey key = privkey.private_decrypt(wrapped) #p privkey.private_decrypt(Base64.decode64(File.read(file_path_key_))) #p key cipher = OpenSSL::Cipher.new('rc4') cipher.decrypt cipher.key = key p cipher.update(cipher_text)
Código PHP:
Ver original
$message = 'hello,world'; $cipher_text = "hi"; $keys = NULL;