Skip to content

Instantly share code, notes, and snippets.

View zhengqm's full-sized avatar

Qimu Zheng zhengqm

View GitHub Profile
@bishboria
bishboria / springer-free-maths-books.md
Last active March 14, 2024 06:09
Springer made a bunch of books available for free, these were the direct links
@gevans
gevans / encryption-decryption.rb
Created July 16, 2013 00:24
A couple examples of using asymmetric RSA signing and encryption using Ruby's OpenSSL libraries.
require 'openssl'
key = OpenSSL::PKey::RSA.new(2048)
p encrypted_string = key.public_encrypt('my plaintext string', OpenSSL::PKey::RSA::PKCS1_OAEP_PADDING)
p decrypted_string = key.private_decrypt(encrypted_string, OpenSSL::PKey::RSA::PKCS1_OAEP_PADDING)
@dirtyhenry
dirtyhenry / poc-openssl-aes.rb
Last active June 5, 2018 11:48
Encryption interoperability demo between Ruby and OpenSSL
require 'openssl'
require 'base64'
# Read the dummy file
data = File.read("test.txt")
# Create an encrypter
cipher = OpenSSL::Cipher::AES.new(256, :CBC)
cipher.encrypt
key = cipher.random_key