RE: OpenSSL DES generates '\n' in encrypted code

2012-08-22 Thread Charles Mills
- From: owner-openssl-us...@openssl.org [mailto:owner-openssl-us...@openssl.org] On Behalf Of Ben Laurie Sent: Tuesday, August 21, 2012 1:47 PM To: openssl-users@openssl.org Subject: Re: OpenSSL DES generates '\n' in encrypted code On Tue, Aug 21, 2012 at 2:14 PM, Charles Mills charl...@mcn.org

OpenSSL DES generates '\n' in encrypted code

2012-08-21 Thread Tarun Thakur
Hi All, Issue is encrypted code contains '\n' which is an major issue for my software application. Given below is problem summarized. I have used OpenSSL library's DES_ede3_ofb64_encrypt() function to perform encryption byte by byte on chunk of 24 bytes. For example: Input 24 bytes are:

OpenSSL DES generates '\n' in encrypted code

2012-08-21 Thread Tarun Thakur
Hi All, Issue is encrypted code contains '\n' which is an major issue for my software application. Given below is problem summarized. I have used OpenSSL library's DES_ede3_ofb64_encrypt() function to perform encryption byte by byte on chunk of 24 bytes. For example: Input 24 bytes are:

Re: OpenSSL DES generates '\n' in encrypted code

2012-08-21 Thread Andrey Koltsov
Hi Tarun. Output of every encryption function is always binary so it can contains ANY character. You should encode this binary string to base64 or hex format by yourself to pass it to your application. Do not forget to do reverse encoding before decrypting. Best regards, Andrey Koltsov

Re: OpenSSL DES generates '\n' in encrypted code

2012-08-21 Thread Tarun Thakur
Hi, Thanks for your reply.. But issue in base64 encoding is it will generate encoded test greater than 24 bytes. Application output should generate encrypted code exactly 24 bytes as input. Thanks, Tarun Andrey Koltsov-2 wrote: Hi Tarun. Output of every encryption function is always

Re: OpenSSL DES generates '\n' in encrypted code

2012-08-21 Thread Andrey Koltsov
Hi. base64 format can encode strings of any length. The encoded result would be longer of course. Best regards, Andrey Koltsov software developer CyberplatSoft Ltd 21.08.2012 11:45, Tarun Thakur пишет: Hi, Thanks for your reply.. But issue in base64 encoding is it will generate encoded

Re: OpenSSL DES generates '\n' in encrypted code

2012-08-21 Thread Matt Caswell (fr...@baggins.org)
As Andrey has said the output from encryption is binary and so can be any character (prinatable and non-printable). Therefore you are going to have to do some kind of encoding of the output to force it to be printablethis is going to increase the length no matter what. What is the allowed set

Re: OpenSSL DES generates '\n' in encrypted code

2012-08-21 Thread Tarun Thakur
Hi All, Thank you very much for your responses. Output of my software application (after encryption and encoding with any mechanism) should be of 24 bytes containing alphanumeric characters only. So, if I get encrypted 24 bytes from plain 24bytes, then which encoding mechanism can convert

Re: OpenSSL DES generates '\n' in encrypted code

2012-08-21 Thread Matt Caswell (fr...@baggins.org)
On 21 August 2012 12:00, Tarun Thakur tarun.tha...@nechclst.in wrote: Hi All, Thank you very much for your responses. Output of my software application (after encryption and encoding with any mechanism) should be of 24 bytes containing alphanumeric characters only. So, if I get encrypted

RE: OpenSSL DES generates '\n' in encrypted code

2012-08-21 Thread Charles Mills
generates '\n' in encrypted code As Andrey has said the output from encryption is binary and so can be any character (prinatable and non-printable). Therefore you are going to have to do some kind of encoding of the output to force it to be printablethis is going to increase the length no matter

RE: OpenSSL DES generates '\n' in encrypted code

2012-08-21 Thread Charles Mills
@openssl.org Subject: OpenSSL DES generates '\n' in encrypted code Hi All, Issue is encrypted code contains '\n' which is an major issue for my software application. Given below is problem summarized. I have used OpenSSL library's DES_ede3_ofb64_encrypt() function to perform encryption byte

Re: OpenSSL DES generates '\n' in encrypted code

2012-08-21 Thread Tarun Thakur
Thank you all for your suggested solutions. Matt Caswell (fr...@baggins.org) wrote: On 21 August 2012 12:00, Tarun Thakur tarun.tha...@nechclst.in wrote: Hi All, Thank you very much for your responses. Output of my software application (after encryption and encoding with any

Re: OpenSSL DES generates '\n' in encrypted code

2012-08-21 Thread Ken Goldman
On 8/21/2012 7:17 AM, Matt Caswell wrote: On 21 August 2012 12:00, Tarun Thakur wrote: Output of my software application (after encryption and encoding with any mechanism) should be of 24 bytes containing alphanumeric characters only. So, if I get encrypted 24 bytes from plain 24bytes, then

RE: OpenSSL DES generates '\n' in encrypted code

2012-08-21 Thread Charles Mills
: OpenSSL DES generates '\n' in encrypted code On 8/21/2012 7:17 AM, Matt Caswell wrote: On 21 August 2012 12:00, Tarun Thakur wrote: Output of my software application (after encryption and encoding with any mechanism) should be of 24 bytes containing alphanumeric characters only. So, if I

Re: OpenSSL DES generates '\n' in encrypted code

2012-08-21 Thread Jakob Bohm
, August 21, 2012 5:49 AM *To:* openssl-users@openssl.org *Subject:* Re: OpenSSL DES generates '\n' in encrypted code As Andrey has said the output from encryption is binary and so can be any character (prinatable and non-printable). Therefore you are going to have to do some kind of encoding

Re: OpenSSL DES generates '\n' in encrypted code

2012-08-21 Thread Matt Caswell (fr...@baggins.org)
Message- From: owner-openssl-us...@openssl.org [mailto: owner-openssl-us...@openssl.org] On Behalf Of Ken Goldman Sent: Tuesday, August 21, 2012 8:46 AM To: openssl-users@openssl.org Subject: Re: OpenSSL DES generates '\n' in encrypted code On 8/21/2012 7:17 AM, Matt Caswell wrote

RE: OpenSSL DES generates '\n' in encrypted code

2012-08-21 Thread Charles Mills
To: openssl-users@openssl.org Subject: Re: OpenSSL DES generates '\n' in encrypted code On 21 August 2012 14:14, Charles Mills charl...@mcn.org wrote: Actually, there IS *almost* a general solution to this problem. The input consists of characters from some set of 'n' characters. (Perhaps 'n' is 94

Re: OpenSSL DES generates '\n' in encrypted code

2012-08-21 Thread Ben Laurie
On Tue, Aug 21, 2012 at 2:14 PM, Charles Mills charl...@mcn.org wrote: Actually, there IS *almost* a general solution to this problem. The input consists of characters from some set of 'n' characters. (Perhaps 'n' is 94 -- 0x21 through 0x7e inclusive -- but it does not matter.) You need to