openssl

SSL_connect SYSCALL returned=5 errno=0 state=SSLv2/v3 read server hello A

Hi, I have a ruby client that connects to an exchange server using IMAP & SSL. I use the Ruby Net::IMAP library (which uses openssl under the covers) to connect. Its been working fine for months. The exchange server admin installed new cert from godaddy and now I get this error: SSL_connect SYSCALL returned=5 errno=0 state=SSLv2/v3 rea...

OpenSSL PHP Function doesn't work

Hi, I'm looking for days how to translate this command to OpenSLL php function: $ openssl pkcs8 -inform DER -in aaa010101aaa_CSD_01.key -out AAA010101AAA.key.pem Enter Password: a0123456789 This work perfect, but I can't (I don't know) use the correct function of PHP OpenSSL http://www.php.net/manual/es/ref.openssl.php I have made th...

Problem with encryption & decryption of binary files

How can I encrypt & decrypt binary files in C using OpenSSL? I have a test program that encrypts and then decrypts the input it's given. I executed my test program for text files, and the output is the same as the input, but when I execute my test program on a binary file the output is not the same as the input. ...

how to encrypt & a binary file in linux c program by using openssl

hi, I am encrypting and decrypting my text files successfully by using openssl but i am not able to do same thing on BINARY FILES. what i can do ? Now i want to implement this in linux c for 1024bits key by using RSA algorithm with OPENSSL ...

openssl.net rsa encryption working example needed

Hi, Does anybody have any working example of RSA encryption with OpenSSL.NET ? I want to encrypt some data using private key stored in PEM format. I create a OpenSSL.Crypto.RSA object and want to use the PrivateEncrypt method, but it throws OpenSSLException with no additional data (empty Errors array, no inner exception). Before using ...

Extracting client certificate & private key from .p12 file

Can anybody tell me how to use PKCS12 *d2i_PKCS12_fp(FILE *fp, PKCS12 **p12); int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert, STACK_OF(X509) **ca); any documenatation reference will also work . Please help me. ...

Apache 2 types SSl using VirtualHosts

I have 2 different applications. 1) tools.helpme.com Require Client Certificates from users! SSLCACertificateFile /usr/local/etc/apache22/certs/cacert.pem SSLCertificateKeyFile /usr/local/etc/apache22/certs/server.key SSLCertificateFile /usr/local/etc/apache22/certs/server.crt SSLCertificateChainFile /usr/local/etc/apache22/certs/serve...

How to implement mutual authentication for client in Openssl using c++?

what all(function calls) i need to do for mutual authentication ? I have searched a lot, but didn't find anything meanigful. can anybody help me doing this ? Please help me. ...

PHP difference between mcrypt and openssl?

Why have these two methods of using blowfish in ecb-mode different outputs? <?php echo bin2hex(mcrypt_encrypt("blowfish", "test", "test", "ecb"))."\n"; echo bin2hex(openssl_encrypt("test", "bf-ecb", "test", true))."\n"; ?> ...

How to convert RSA key numbers into OpenSSL-compatible keys?

I want to be able to generate private/public RSA keys with javascript only... So far I found http://www.hanewin.net/encrypt/rsa/rsa.htm, it includes the only Javascript RSA key generator I found. I created wrappers (modifying the code from the demo page (see link)), here's the one for the keys: function genKeys() { rsaKeys(1024); var...

How can I install Crypt::SSLeay on a Win 64?

I've got 64-bit Vista with ActiveState Perl "v5.10.0 built for MSWin32-x64-multi-thread" and I'm trying to get the Crypt::SSLeay package installed along with versions of libeay32.dll and ssleay32.dll. I've done this before on a Win32 machine using the 'uwinnipeg' server, but I'm running into issues with my 64-bit system. ppm install ht...

PHP + OpenSSL : error returned, but correct result

Hi, I am trying to use OpenSSL function for RSA sign/verify in PHP. When I try to do openssl_verify using my public key, I am getting this error: "error:0906D06C:PEM routines:PEM_read_bio:no start line", but the function itself works correctly (returns 0 if messages was modified, and 1 if intact). openssl_sign works fine. How can I fix ...

Validate Certificate using Python

I want to access a web service over HTTPS. I have been given a client certificate (p12 file) in order to access it. Previously we were using basic authentication. Using python I am unsure how to access it. I want to use httplib2 h = Http() #h.add_credentials("testuser", "testpass") #h.add_certificate(keyfile, certfile, '') resp, cont...

How to clean up a bad OpenSSL connection

If a call to SSL_accept fails, I want to just bail out. Currently I'm calling SSL_shutdown and then SSL_free, but since implementing this, two customers have had crashes deep down in OpenSSL (when calling SSL_accept at a later time), so I'm guessing maybe this isn't the best way to clean up. The docs say SSL_shutdown is used to correct...

different results for openssl base64 and PHP base64_encode

I am trying to base64 encode a string in PHP and openssl. openssl: echo -n "1234567890A" | openssl enc -base64 php: $hash = sha1("1234567890A", true); var_dump($hash); echo base64_encode($hash); the results differ: openssl: MTIzNDU2Nzg5MEE= PHP: /Q6nenquhGpX5h2WdiQZQF47Pe8= I guess this is just a simple setting I can use to a...

Fast, Secure Random Numbers

Hello Friends, I was searching for a faster alternative to /dev/urandom when I stumbled across this interesting tidbit: One good trick for generating very good non-random-but-nearly-random bits is to use /dev/random's entropy to seed a fast symmetric stream cipher (my favorite is blowfish), and redirect it's output to the applicatio...

openssl_pkey_get_public not open public key, "no start line" error

When generating public key and then reading it with function openssl_pkey_get_public - $publicKeyResource = bool(false) and message: error:0906D06C:PEM routines:PEM_read_bio:no start line $privateKey = openssl_pkey_new(array('private_key_bits' => 2048, 'private_key_type' => OPENSSL_KEYTYPE_RSA)); $keyDetails = openssl_pkey_get_details(...

SSL_Connection failed with SSL_ERROR_SYSCALL with errno=2?

SSL_Connect API is failing with return value 5 errno=2. can any one help me in how to trace the same? can any one let me know what could cause this issue? OS: Windows 2003 Std Sp2 32 bit ...

[OpenSSL] SSL_accept() throws "Invalid argument" error

I'm attempting to create a client/server program, but I'm finding some difficulty continuing with the unfortunately sparse amount of OpenSSL documentation. My issue: SSL_accept throws an "Invalid Argument" upon executing the following code (simplified): SSL* ssl = SSL_new(ctx); // ctx is created earlier SSL_set_fd(ssl, socket); // sock...

how to create SSL for MySQL in Windows

how do i create SSL for MySQL in Windows? i have downloaded a OpenSSL but don't know how to get it work in Windows since all the commands are in UNIX shell. help anyone? ...