RE: java to openssl

2012-01-16 Thread Dave Thompson
From: owner-openssl-us...@openssl.org On Behalf Of Philip R. Landreth Sent: Friday, 13 January, 2012 09:55 The files were given to me in .txt format and the original file is a .txt. as for the keyfile being in .txt I don't know. I used -p to print the key and iv and used those instead of

RE: java to openssl

2012-01-13 Thread Philip R. Landreth
: Thursday, January 12, 2012 6:58 PM To: openssl-users@openssl.org Subject: RE: java to openssl From: owner-openssl-us...@openssl.org On Behalf Of Philip R. Landreth Sent: Thursday, 12 January, 2012 09:33 I was sent 2 files and a partial java code that another company uses

java to openssl

2012-01-12 Thread Philip R. Landreth
I am new to this so go easy on me. I had this dropped in my lap and have limited info but here is what I have. I was sent 2 files and a partial java code that another company uses to decrypt. import java.io.InputStream;   import javax.crypto.Cipher; import javax.crypto.SecretKey; import 

RE: java to openssl

2012-01-12 Thread Dave Thompson
From: owner-openssl-us...@openssl.org On Behalf Of Philip R. Landreth Sent: Thursday, 12 January, 2012 09:33 I was sent 2 files and a partial java code that another company uses to decrypt. snip and realigned byte[] encryptedData = (byte[])msg.getBody().get();

Re: Padding issue with Java and OpenSSL

2009-03-24 Thread Ger Hobbelt
(0x03 0x03 0x03). If I use OpenSSL to encrypt the same file, it results in a file of 65373 bytes. I expected 65376 since 65373 is not a multiple of 128. Shouldn't OpenSSL be padding the file? Is Java or OpenSSL not doing its job correctly? I'm I supposed to strip these bytes myself? I'm using

Padding issue with Java and OpenSSL

2009-03-23 Thread Philippe Laflamme
expected 65376 since 65373 is not a multiple of 128. Shouldn't OpenSSL be padding the file? Is Java or OpenSSL not doing its job correctly? I'm I supposed to strip these bytes myself? I'm using openssl on the command line, is there an option to pass to openssl enc ? Thanks! Philippe

Re: Pass DES encrypted data between Java and openssl

2006-12-06 Thread Marc Saegesser
Steve, Thanks for the help. I finally got this working and figured I'd reply here in case this might help others. I found a Java implementation of EVP_BytesToKey() in the JRuby code and borrowed it. I ran the password through it and the key and IV I got back didn't mach what openssl enc -d

Re: Pass DES encrypted data between Java and openssl

2006-12-05 Thread Julius Davies
Hi, Marc, If you download the not-yet-commons-ssl.jar I'm working on, you can decrypt your file with the Java code I've included below. I tested using Sun Java 1.4.2. Notice the password in the example: char[] pwd = secret.toCharArray(); http://juliusdavies.ca/commons-ssl/download.html

Re: Pass DES encrypted data between Java and openssl

2006-12-05 Thread Julius Davies
Whoops! This method only takes an InputStream on my LOCAL machine. :-$ PKCS8Key.decrypt( DES, CBC, dk, false, null, fin ); You'll need to replace that line with: byte[] bytes = Util.streamToBytes( fin ); PKCS8Key.decrypt( DES, CBC, dk, false, null, bytes ); yours, Julius On 12/5/06,

Re: Pass DES encrypted data between Java and openssl

2006-12-05 Thread Marc Saegesser
Steve, Thanks for the help. I finally got this working and figured I'd reply here for posterity's sake. I found a Java implementation of EVP_BytesToKey() in the JRuby code and borrowed it. I ran the password through it and the key and IV I got back didn't mach what openssl enc -d -des -p

Pass DES encrypted data between Java and openssl

2006-12-04 Thread Marc Saegesser
I have an existing application (which I don't control) that sends me files that were encrypted using an openssl comand like: openssl enc -e -des -pass pass:passphrase I would like to decrypt these files inside a Java application and generate response files that the client can decrypt using a

Re: Pass DES encrypted data between Java and openssl

2006-12-04 Thread Dr. Stephen Henson
On Mon, Dec 04, 2006, Marc Saegesser wrote: I have an existing application (which I don't control) that sends me files that were encrypted using an openssl comand like: openssl enc -e -des -pass pass:passphrase I would like to decrypt these files inside a Java application and generate

Private key from Java to OpenSSL

2002-01-13 Thread Tomas Anderson
(mod_ssl)). Apache works like a dream when tested (compared to java.) with OpenSSL made keys and cert. I do like this in Java to dump the key from out Java keystore: RSAPrivateCrtKey k = (RSAPrivateCrtKey) keystore.getKey(alias, password.toCharArray()); FileOutputStream fo = new

Re: Private key from Java to OpenSSL

2002-01-13 Thread Dr S N Henson
Tomas Anderson wrote: I have a java keystore and want to export the private key and certificate (Verisign 128-bits) in it for use with Apache (we are changing server from a java-based server to Apache (mod_ssl)). Apache works like a dream when tested (compared to java.) with OpenSSL

Java and openssl

2001-02-08 Thread mickb
Hi, I have a problem interfacing a java server and an openssl client. On the server I am using Cryptix 3.2 and the client is using a openssl 0.9.6. Java's keytool is used on the server to store all the certificates and server's public key. I create a self signed X509