lib/megar/crypto/support.rb
def openssl_rsa_decrypt(m, pqdu)
    rsa = openssl_rsa_cipher(pqdu)

    chunk_size = 256 # hmm. need to figure out how to calc for "data greater than mod len"
    # number.size(self.n) - 1 : Return the maximum number of bits that can be handled by this key.
    decrypt_texts = []
    (0..m.length - 1).step(chunk_size) do |i|
      pt_part = m[i,chunk_size]
      decrypt_texts << rsa.private_decrypt(pt_part,3)
    end
    decrypt_texts.join
  end
# Returns the private key decryption of +m+ given +pqdu+ (array of integer cipher components)
# This implementation uses OpenSSL RSA public key feature.
#
# NB: can't get this to work exactly right with Mega yet
Returns the private key decryption of +m+ given +pqdu+ (array of integer cipher components)
This implementation uses OpenSSL RSA public key feature.

can't get this to work exactly right with Mega yet
Returns the private key decryption of + m + given + pqdu + ( array of integer cipher components ) This implementation uses OpenSSL RSA public key feature . can ' t get this to work exactly right with Mega yet
def openssl_rsa_decrypt(m, pqdu)
    rsa = openssl_rsa_cipher(pqdu)
    chunk_size = 256 
    decrypt_texts = []
    (0..m.length - 1).step(chunk_size) do |i|
      pt_part = m[i,chunk_size]
      decrypt_texts << rsa.private_decrypt(pt_part,3)
    end
    decrypt_texts.join
  end
def openssl_rsa_decrypt ( m , pqdu ) rsa = openssl_rsa_cipher ( pqdu ) chunk_size = 256 decrypt_texts = [ ] ( 0 .. m . length - 1 ) . step ( chunk_size ) do | i | pt_part = m [ i , chunk_size ] decrypt_texts << rsa . private_decrypt ( pt_part , 3 ) end decrypt_texts . join end
Returns the private key decryption of +m+ given +pqdu+ (array of integer cipher components)
This implementation uses OpenSSL RSA public key feature.
Returns the private key decryption of + m + given + pqdu + ( array of integer cipher components ) This implementation uses OpenSSL RSA public key feature .
# hmm. need to figure out how to calc for "data greater than mod len" # number.size(self.n) - 1 : Return the maximum number of bits that can be handled by this key.
m
pqdu