I'm trying to sign and validate signature in RSA+SHA1 with PKCS1 v2.0 padding. I haven't found in the documentation (JDK or JCE) which algorithm/padding I have to use. It seems that I've to use OAEP padding but I didn't succeed: For validation, I've

I'm trying to use the Chilkat C++ library to do a cryptography assignment, but I cannot seem to get the library to link properly. As of right now the header file CkRsa.h cannot be found by the compiler. I've spent a few hours searching across the int

Until now I used JSEncrypt which is able to load a public key from a PEM formatted string. And then use it with RSA in order to encrypt a string. For example : <textarea id="pubkey">-----BEGIN PUBLIC KEY----- MIGfMA0GCSqGSIb3DQEBAQUAA4GNAD

I am looking for ASN1 grammar file for DER ASN1 encoding of RSA keys I am looking for grammar file so that i can compile it using ASN1C compiler and subsequently write my own 'c' code using GMP to extract public key out of a given RSA key file. It wi

I'm using the Crypto++ library, and I created this simple class: class EncoderRSA { public: EncoderRSA(); void keyGeneration(); void substitutePublicKey(Integer e, Integer n); Integer encode(std::string plainText); std::string decode(Integer cypher);

Symmetric keys (AES, 3DES, ...) can be diversified by a specified diversification input. It is usually done this way: DivKey = Enc[PlainText = Key, IV = DivInput, K = Key] However, this is based on the fact that each 16-byte array is a valid AES key.

I have a public key that's sent from a Java server. The base64 encoded strings match before I decode and strip out the ASN.1 headers. I store the public key in the keychain with SecItemAdd. So I'm trying to encrypt the data using the public key and d

I have a .cer file starts with "-----BEGIN CERTIFICATE-----" and end with "-----END CERTIFICATE-----", now I need to load it to check signature with openssl, those are what i've tried: FILE *pub_fp = fopen(certpath.c_str(), "r&quo

I tried implementing the Lehmann test but it doesn't work the first time round. I followed what everyone described Calculate r = [ a^( (p -1) / 2) ] mod p If r is not 1 or –1 then p is definitely not a prime. If r = 1 or –1 the likelihood that p is n

I'm trying to use Fermat's factorization method http://en.wikipedia.org/wiki/Fermat%27s_factorization_method to factor a RSA exercise with n = pq = 17113393402958118715148546526344227921781458985077442510282855190555424972779474416264134494113 Here's

I want to encrypt (RSA) a character to an integer using its ASCII value. Eg. 'a' is encrypted as 48. For encryption: c=pow(m,e)%n where c is cipher text, m is the plain text and (e,n) is the public key. If pow(m,e) is large say 67^7, it won't fit in

I need to use openssl within my php project, so I created a test php page using openssl. However, I keep getting these errors and I am not sure why. openssl is enabled. Warning: openssl_pkey_export() [function.openssl-pkey-export]: cannot get key fro

Edit - clarified I'm trying to implement modular exponentiation in Java using lagrange and the chinese remainder theorem. For example, if N is 55, having been given the prime factors 5 and 11, phi is 40, so I know there are 40 numbers co-prime to N b

I am trying to encode a message using a public key provided to me by an external site using Python M2Crypto's RSA. Essentially, I am doing something like this: from M2Crypto import RSA import os rsa = RSA.load_pub_key(os.path.join(BASE_PATH, 'externa

The Problem: Retrieving a public key For an iPhone App, I need to create a rsa key pair, store it in the key chain and retrieve the public key. Fortunately, Apple released a Crypto Exercise Sample where everything i need can be found (class SecKeyWra

I see stuff all over Google on how to see the RSA key fingerprint, but not the ECDSA fingerprint.Wait, I found it. Run the command: ssh-keygen -l -f /etc/ssh/ssh_host_ecdsa_key.pub

First, I have only written the code below for academic purposes. The reason I say this is because I am not putting this in a production environment, and therefor am "bypassing" some of the overhead that I would need to do if I was, I simply need

I am using following statement to create a RSA public and private key. openssl genrsa -out ksign_private.pem 1024 openssl rsa -in ksign_private.pem -pubout > ksign_public.pem Then I have program that uses, PEM_read_RSAPrivateKey, EVP_PKEY_assign_RSA,

I am implementing an RSA encryption program. Right now I am using BigInteger.probablePrime(1024, rnd) where rnd is a random number generated by Random rnd = new Random() to get prime numbers. I need to test various speeds of encryption. My question i

How to sign data with .p12 file in Java? Java seems to support only until pkcs11, I just can't find the standard library for pkcs12. There's nothing in 'java.security'... for decoding .p12 file to get private key to perform signing. Any solution? I'm

Up to now, I thought that if I have RSA-encrypted data, this data would be easily exchangable between most platforms (.net, java, pc, unix..), because of the commonly used algorithm. Through investigating for another questions I had, I'm now confused

I'm trying to set up a server that will be logged into by people paying for a service I offer, but I want to make sure that only those people who I want can access it. I obviously can't simply give each one a different user account because they could

I use OpenSSL with PHP to generate Public/Private Key in PEM Format. In PHP I create Public/Private Key : // generate a 1024 bit rsa private key $privateKey = openssl_pkey_new(array( 'private_key_bits' => 1024, 'private_key_type' => OPENSSL_KEYTYPE_

from Crypto.PublicKey import RSA private = RSA.generate(1024, os.urandom) Now how do I export or import keys? Everything is there except these 2 functions! private.exportKey() private.publickey.exportKey() Preferably in --armor format :) Any ideas? T

I am using Java 1.4.2_10 and I am trying to use RSA encryption: I am getting the NoSuchAlgorithmException for the following code: cipher = Cipher.getInstance("RSA"); This is the error: java.security.NoSuchAlgorithmException: Cannot find any prov

Given an java.security.interfaces.RSAKey, how do I get it's size?You could try this: key.getModulus().bitLength();

I want to provide my application with simple licensing mechanism based on RSA algorithm. Are there any free RSA libraries?Just use the javax.crypto and java.security packages. It's in the Java standard platform. KeyPair keys = KeyPairGenerator.getIns

I'm going to integrate a license key generator in my web site, in the way that It can automatically generate license keys when occurs a paypal notification (IPN)... but my question is: what is the best way to protect the php file (that contains the m

I have to implement a digital envelope using AES and RSA, but I am having problems with the .NET implementation of the RSA algorithm. I have managed to encrypt the data (AES) with the random symmetric key, but now I have to encrypt the key with RSA.

DWORD nSize; LPBYTE lpData; HCRYPTKEY hPublicKey; nSize = ReadFromFile(lpszUserPublicKey, NULL); if(nSize == -1) return FALSE; lpData = new BYTE[nSize]; ReadFromFile(lpszUserPublicKey, lpData); if(!CryptImportKey(hProv, lpData, nSize, NULL, 0, &hPubl