Re: sign/verify kicking my ass

2008-12-03 Thread Shaun R.
OK, i converted over to EVP_*, the sign/verify works but now i'm confused about decrypt, for EVP_DecryptInit i need to tell it a CIPHER but i dont see RSA in the cipher listings on http://www.openssl.org/docs/crypto/EVP_EncryptInit.html# Looking closer at the man page it looks like RSA isnt co

long base64, no wrap

2008-12-02 Thread Shaun R.
Using EVP_DecodeInit and EVP_DecodeUpdate to decode base64, is there a simple way or function that can be used to split the data with \n's? For example my base64 encoded data was encoded as one long string (like base64 -w 0 would give you). EVP_DecodeUpdate doesnt look to like long base64 str

valgrind and BIO_new_mem_buf

2008-12-01 Thread Shaun R.
valgrind --leak-check=yes shows the below message, trying to figure out what i need to do to correct this. i do have BIO_free(verify_bio); before the function returns ==29460== 280 bytes in 10 blocks are still reachable in loss record 1 of 1 ==29460==at 0x40053C0: malloc (vg_replace_mallo

sign/verify kicking my ass

2008-11-22 Thread Shaun R.
Can anybody help me out, not sure whats going wrong. My test case right now is the following gcc sign.c -o sign -lcrypto gcc verify.c -o verify -lcrypto ./sign > blah.sig ./verify [EMAIL PROTECTED] openssl]# cat sign.c #include #include #include #include #include #include #include #i

RSA_sign RSA_verify

2008-11-18 Thread Shaun R.
Where am i going wrong here? [EMAIL PROTECTED] openssl]# cat sign_verify.c #include #include #include #include #include #include #include #include int main(void) { char* message = "Hello World"; unsigned char* signature; unsigned int slen; unsigned int veri

how to verify if the public_key is valid to decrypt data using RSA_public_decrypt()

2008-11-17 Thread Shaun R.
I'm using RSA to encrypt/decrypt some text. I encrypt the data using the private key and then decrypt it using RSA_public_decrypt(). One thing i noticed was that if the data was not encrypted using the correct private key that RSA_public_decrypt() will just set the output to giberish. Is ther