openssl-enc: needs additional base64 garbage check?

2024-07-04 Thread Steffen Nurpmeso
Hello. #?1|kent:tmp$ x=U2FsdGVkX19hzr7eekkcCcfeydWYK7HAeLr2lRPThis [ ^ $? of last command] #?0|kent:tmp$ printf ${x}= | openssl enc -aes256 -k "dubidada" -a -A -pbkdf2 -d #?0|kent:tmp$ printf ${x}=t | openssl enc -aes256 -k "dubidada" -a -A -pbkdf2 -d #?0|kent:tmp$ printf ${x}=to | ope

RE: Base64 or Base64url

2019-10-18 Thread Benjamin ENTE
De : Dr. Matthias St. Pierre Envoyé : vendredi 18 octobre 2019 09:10 À : Benjamin ENTE ; openssl-users@openssl.org Objet : AW: Base64 or Base64url Just noticed your OpenSSL version: it is _very_ old and not supported anymore. its successor, OpenSSL 1.0.2, will be EOL by the end of this yea

AW: Base64 or Base64url

2019-10-18 Thread Dr. Matthias St. Pierre
@openssl.org Betreff: AW: Base64 or Base64url Just noticed your OpenSSL version: it is _very_ old and not supported anymore. its successor, OpenSSL 1.0.2, will be EOL by the end of this year. The current stable LTS version is OpenSSL 1.1.1. Matthias Von: openssl-users mailto:openssl-users-boun

AW: Base64 or Base64url

2019-10-18 Thread Dr. Matthias St. Pierre
An: openssl-users@openssl.org Betreff: Base64 or Base64url Hi everyone I'm looking for an information I can't find. I'm using OpenSSL 1.0.1e 11 Feb 2013 and I want to know if it's encoding in base64 or in base64url. Thank you in advance for your help Best regar

AW: Base64 or Base64url

2019-10-18 Thread Dr. Matthias St. Pierre
OpenSSL is using regular base64 encoding, see for example https://www.openssl.org/docs/man1.1.1/man3/EVP_EncodeInit.html But if you need base64url encoding, no problem: a simple string replace will help. https://brockallen.com/2014/10/17/base64url-encoding/ Regards, Matthias Von: openssl

Base64 or Base64url

2019-10-17 Thread Benjamin ENTE
Hi everyone I'm looking for an information I can't find. I'm using OpenSSL 1.0.1e 11 Feb 2013 and I want to know if it's encoding in base64 or in base64url. Thank you in advance for your help Best regards Benjamin [http://www.cromology.com/mail/cromology-it.gif] Ben

Re: [openssl-users] base64 decode in C

2015-03-19 Thread Prashant Bapat
d. >> >> >> >> >> >> *From:* openssl-users [mailto:openssl-users-boun...@openssl.org] *On >> Behalf Of *Prashant Bapat >> *Sent:* Wednesday, March 18, 2015 8:08 AM >> *To:* openssl-users >> *Subject:* Re: [openssl-users] base64 decode in C >

Re: [openssl-users] base64 decode in C

2015-03-19 Thread Prashant Bapat
> *From:* openssl-users [mailto:openssl-users-boun...@openssl.org] *On > Behalf Of *Prashant Bapat > *Sent:* Wednesday, March 18, 2015 8:08 AM > *To:* openssl-users > *Subject:* Re: [openssl-users] base64 decode in C > > > > Hi Dave and Walter, > > > > Thanks

Re: [openssl-users] base64 decode in C

2015-03-18 Thread Scott Neugroschl
Sent: Wednesday, March 18, 2015 8:08 AM To: openssl-users Subject: Re: [openssl-users] base64 decode in C Hi Dave and Walter, Thanks for our reply. I'm not doing anything different for the ssh pubkey. I'm able to decode it using the "openssl enc -base64 -d -A" command.

Re: [openssl-users] base64 decode in C

2015-03-18 Thread Walter H.
On 18.03.2015 16:08, Prashant Bapat wrote: printf("Base64 decoded string is : %s\n", b64_decode(str, strlen(str))); // This should print binary for a ssh key. not really, because the return of b64_decode is not a C string; and the format specfier %s expects a C string;

Re: [openssl-users] base64 decode in C

2015-03-18 Thread Jakob Bohm
Please refer to Dave Thompson's answer, it describes your problem. On 18/03/2015 16:08, Prashant Bapat wrote: Hi Dave and Walter, Thanks for our reply. I'm not doing anything different for the ssh pubkey. I'm able to decode it using the "openssl enc -base64 -d -A" co

Re: [openssl-users] base64 decode in C

2015-03-18 Thread Ken Goldman
As someone already posted, you can't use strlen on an array that is not a string. On 3/18/2015 11:08 AM, Prashant Bapat wrote: Hi Dave and Walter, Thanks for our reply. I'm not doing anything different for the ssh pubkey. I'm able to decode it using the "openssl enc -b

Re: [openssl-users] base64 decode in C

2015-03-18 Thread Prashant Bapat
Hi Dave and Walter, Thanks for our reply. I'm not doing anything different for the ssh pubkey. I'm able to decode it using the "openssl enc -base64 -d -A" command. But not using the C program. Attaching my entire code here. After getting the base64 decoded I'm ca

Re: [openssl-users] base64 decode in C

2015-03-18 Thread Walter H.
Hi, before calling this function, remove any whitespace; Walter smime.p7s Description: S/MIME Cryptographic Signature ___ openssl-users mailing list To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users

Re: [openssl-users] base64 decode in C

2015-03-18 Thread Dave Thompson
> From: openssl-users On Behalf Of Prashant Bapat > Sent: Wednesday, March 18, 2015 03:37 > I'm trying to use the base64 decode function in C. > This works well for simple b64 encoded strings like "hello world!" etc. > But when I want to b64 decode the contents

[openssl-users] base64 decode in C

2015-03-18 Thread Prashant Bapat
Hi, Most likely this has been answered before, please bear with me. I'm trying to use the base64 decode function in C. Below is the function. char *b64_decode(unsigned char *input, int length) { BIO *b64, *bmem; char *buffer = (char *)malloc(length); memset(buffer, 0, l

Re: Convert symmetrically encrypted content to base64

2012-08-27 Thread Bjoern Schiessle
On Fri, 24 Aug 2012 15:54:50 -0400 Dave Thompson wrote: > Note OpenSSL's RSA privatekey *includes* publickey. > RSA publickey is n,e and naive privatekey is n,d, > but OpenSSL privatekey is CRT form with n,d,e,p,q + more. > There is no need to transmit the publickey separately, > > [..] > > >

RE: Convert symmetrically encrypted content to base64

2012-08-24 Thread Dave Thompson
> From: owner-openssl-us...@openssl.org On Behalf Of Bjoern Schiessle > Sent: Friday, 24 August, 2012 12:14 > Now I'm trying the implement the function > which does exactly the opposite: Take the public and private key in > the PEM format from the server and import it in a RSA structure: > Note

Re: Convert symmetrically encrypted content to base64

2012-08-24 Thread Bjoern Schiessle
Hi Christian, On Fri, 24 Aug 2012 08:11:25 +0200 Christian Hohnstaedt wrote: > please see my comments below: > (rather Qt and memory related) Thank you for your feedback. Now I'm trying the implement the function which does exactly the opposite: Take the public and private key in the PEM format f

Re: Convert symmetrically encrypted content to base64

2012-08-23 Thread Christian Hohnstaedt
Hi Bjoern, please see my comments below: (rather Qt and memory related) On Thu, Aug 23, 2012 at 03:12:55PM +0200, Bjoern Schiessle wrote: > > QMap Encryption::key2pem(RSA *rsa, QString password) > { > QMap keypair; > BUF_MEM *bptr; > BIO *pubBio = BIO_new(BIO_s_mem()); > BIO *pri

Re: Convert symmetrically encrypted content to base64

2012-08-23 Thread Bjoern Schiessle
Hi, I think I did it way too complicated. I think the problem was that I always tried to mimic some openssl php code I know, but I think the solution I have now is much easier and standard complained: void Encryption::generateUserKeys(QString password) { RSA *rsa; EVP_PKEY *pkey; int

Convert symmetrically encrypted content to base64

2012-08-23 Thread Bjoern Schiessle
Hi, I want to generate a RSA private and public key and than encrypt the private key symmetrically with a password to store it on a server. The data has to be stored and transferred base64 encoded. This is how I encrypt the private key: EVP_CIPHER_CTX ctx; unsigned char *key

RE: [FWD] BUG: base64

2012-06-29 Thread Dave Thompson
> From: owner-openssl-us...@openssl.org On Behalf Of Lutz Jaenicke > Sent: Friday, 29 June, 2012 15:10 > Forwarded to openssl-users for public discussion (attachment: 80-char lines of base64 that didn't decode) OpenSSL BIO_f_base64 by default tries to nearly enforce the MI

[FWD] BUG: base64

2012-06-29 Thread Lutz Jaenicke
Forwarded to openssl-users for public discussion Best regards, Lutz -- Lutz Jaenicke jaeni...@openssl.org OpenSSL Project http://www.openssl.org/~jaenicke/ --- Begin Message --- I found a possible bug with base64 decoding, the following block can't be decoded by op

How to properly base64-encode a buffer

2011-12-17 Thread pf
I have this buffer given: unsigned char *buffer; int buffer_length; This is how I currently convert it to a base64-encoded buffer: --- BIO *mem = BIO_new(BIO_s_mem()); BIO *b64 = BIO_new(BIO_f_base64()); mem = BIO_push(b64, mem); int write_length = BIO_write(mem

RE: Missing data trying to Base64 Decode a AES-256-CBC encrypted file

2011-11-23 Thread Dave Thompson
f C -- maybe 80-90%, depending how you count -- but NOT all. So in some cases it matters which you are using. > I'm having issues base64 decoding files that have been > encrypted using AES-256-CBC and the base64 encoded. I'm > using the following code to base64 d

Re: Conversion of RSA Encrypted message to Base64 format !!!

2011-04-20 Thread Wim Lewis
On 20 Apr 2011, at 3:01 AM, pattabi raman wrote: > How can I use the funtion "BIO_new_fp(stdout, BIO_NOCLOSE)" to print the > value to another character array instead of "stdout"? If not this, which Bio_ > function I can use so that it will convert to Base64 and pu

Conversion of RSA Encrypted message to Base64 format !!!

2011-04-20 Thread pattabi raman
Hi, I have done the RSA encryption program. Now I want to convert that encrypted message to BASE64 message inorder to send the message via socket. I am trying the following sample code which converts "Hello World" to Base64 format and *printing in console* ( stdout). *How can I use t

RE: Base64 Encoding and Decoding error

2011-03-03 Thread Jeremy Farrell
> From: Dave Thompson > Sent: Thursday, March 03, 2011 10:35 PM > To: openssl-users@openssl.org > > Also, the byte that terminates a C (narrow) string is a null > character or null byte, sometimes called NUL (note 3 letters). > But this character is not IN the string, it is AFTER the string.

RE: Base64 Encoding and Decoding error

2011-03-03 Thread Dave Thompson
> From: owner-openssl-us...@openssl.org On Behalf Of Vinay Kumar L > Sent: Tuesday, 01 March, 2011 23:42 > Thanks for your reply, but OpenSSL Base64 decoding api returns NULL > on passing Base64 encoded data. The code snippet is as follows: I very much doubt it

Re: Base64 Encoding and Decoding error

2011-03-01 Thread Vinay Kumar L
Hi Jan, Thanks for your reply, but OpenSSL Base64 decoding api returns NULL on passing Base64 encoded data. The code snippet is as follows: int main(int argc, char **argv) { char *output = unbase64("dGVzdGVuY29kaW5nCg==", strlen("dGVzdGVuY29kaW5nCg==")); pr

Re: Base64 Encoding and Decoding error

2011-02-28 Thread Jan Steffens
On Tue, Mar 1, 2011 at 7:00 AM, Vinay Kumar L wrote: > Encoding of string "testencoding" using base64 command: > > #base64 data.txt > encode.txt >     data.txt -> It contains only the string "testencoding" >     encode.txt -> It contains encoded

Base64 Encoding and Decoding error

2011-02-28 Thread Vinay Kumar L
Hi All, I am doing Base64 encoding and decoding of a string "testencoding" using OpenSSL api *BIO_f_base64, *but when Base64 encoding is done for the same string using OpenSSL command *base64,* the last byte of encoded data will be different than the one generated using *BIO_f_b

RE: B64_read_PKCS7 : Anyone modified the base64 reader to be more forgiving?

2010-11-03 Thread Dave Thompson
I now don't see any good solution to your problem other than correcting the input so that b64BIO accepts it. The apparent alternative would be to duplicate most of SMIME_read: parse the MIME, decode base64 more leniently, and parse that result as (DER) PKCS7. Yuck. Or you could change b64_

RE: B64_read_PKCS7 : Anyone modified the base64 reader to be more forgiving?

2010-11-02 Thread Harakiri
--- On Thu, 10/28/10, Dave Thompson wrote: > From: Dave Thompson > Subject: RE: B64_read_PKCS7 : Anyone modified the base64 reader to be more > forgiving? > To: openssl-users@openssl.org > Date: Thursday, October 28, 2010, 7:00 PM > > From: owner-openssl-us...@opens

RE: B64_read_PKCS7 : Anyone modified the base64 reader to be more forgiving?

2010-11-02 Thread Harakiri
--- On Thu, 10/28/10, Dave Thompson wrote: > From: Dave Thompson > Subject: RE: B64_read_PKCS7 : Anyone modified the base64 reader to be more > forgiving? > To: openssl-users@openssl.org > Date: Thursday, October 28, 2010, 7:00 PM > > From: owner-openssl-us...@opens

RE: B64_read_PKCS7 : Anyone modified the base64 reader to be more forgiving?

2010-10-28 Thread Dave Thompson
> From: owner-openssl-us...@openssl.org On Behalf Of Harakiri > Sent: Thursday, 28 October, 2010 07:52 > I'm getting alot of wrongly encoding mails lately from > different sources, they have base64 lines which exceeds the > standard. I.e. in between one line > is 4 char

B64_read_PKCS7 : Anyone modified the base64 reader to be more forgiving?

2010-10-28 Thread Harakiri
I'm getting alot of wrongly encoding mails lately from different sources, they have base64 lines which exceeds the standard. I.e. in between one line is 4 characters longer, then the next lines are all shifted by these 4 characters. i.

RE: Blowfish Encrypt / Decrypt (also base64)

2010-10-18 Thread Dave Thompson
> From: owner-openssl-us...@openssl.org On Behalf Of emyr > Sent: Monday, 18 October, 2010 07:33 > Anyway, I now have another issue. > What I'm trying to do is to encrypt a password using blowfish, then > base64 it for writing as a string into a config file

Re: Blowfish Encrypt / Decrypt (also base64)

2010-10-18 Thread emyr
Hi, Ah yes... thanks for that Dave. Been doing C++ too much and a bit rusty on the nuances of pointer stuff... Anyway, I now have another issue. What I'm trying to do is to encrypt a password using blowfish, then base64 it for writing as a string into a config file (it has to be a

RE: Can't get RSA object from .pem file after base64 decoding it

2010-07-12 Thread Dave Thompson
1024 bits. Note the most data you can encrypt per call is keysize=128 - about 40 bytes overhead = about 85 bytes. > NSLog(@"encrypted message %i", (int)encrypted); > //Here I get a large negative number (- 974687...) It's not an int. It's 'resultE

Re: Can't get RSA object from .pem file after base64 decoding it

2010-07-12 Thread Ger Hobbelt
2010/7/12 Carlos Saldaña > unsigned char encrypted[2560] = { 0 }; > int resultEncrypt = 0; > > resultEncrypt = RSA_public_encrypt ( strlen(text) + 1 , (unsigned char > *)text, encrypted, rsa_rpu, RSA_PKCS1_OAEP_PADDING ); > NSLog(@"%d from encrypt.", resultEncrypt); > //This line prin

Re: Can't get RSA object from .pem file after base64 decoding it

2010-07-12 Thread Carlos Saldaña
m > file > > and ir has the -BEGIN PUBLIC KEY- and -END PUBLIC KEY- > headers. > > I fixed my code to take away this headers and then base64 decode the > string. > > Okay, that's simple enough. Note that your security relies on the > authenticity >

RE: Can't get RSA object from .pem file after base64 decoding it

2010-07-09 Thread Dave Thompson
the contents of this .pem file > and ir has the -BEGIN PUBLIC KEY- and -END PUBLIC KEY- headers. > I fixed my code to take away this headers and then base64 decode the string. Okay, that's simple enough. Note that your security relies on the authenticity and integrit

Re: Can't get RSA object from .pem file after base64 decoding it

2010-07-09 Thread Carlos Saldaña
s and then base64 decode the string. I'm new to this technology of using openssl and using certificates, this is the code I've buit, so far I don't get any RSA object from the d2i_RSAPublicKey function: //Get the .pem file contents NSString *path = [[NSBundle mainBundle] pathFor

RE: Can't get RSA object from .pem file after base64 decoding it

2010-07-08 Thread Dave Thompson
ese files, just give the correct files to openssl in the correct places. > So far I've dicovered that .pem files are just base64 encoded DER files, > DER is the encoding for x509 files that contain the publickey among other information. Only partly right. .pem files are (just) base

Can't get RSA object from .pem file after base64 decoding it

2010-07-08 Thread Carlos Saldaña
Hi, I'm to openssl and PKI in general and got a problem whit decrypting in my application. My partners provided me with two files: publickey.x509 and publickey.pem to find a wy to send messages between server and my client application. So far I've dicovered that .pem files are j

Re: Base64 Decode Problem

2010-05-21 Thread Felipe Franciosi
Kehn wrote: Hi All, I'm trying to decode a base64 encoded string. The problem I'm running in to is that BIO_read() always returns 0. BIO_should_retry() and BIO_should_read() also return 0 when BIO_read() returns 0. If the base64 encoded string is shortened, BIO_read returns t

Re: Base64 Decode Problem/Question

2010-05-20 Thread Doug Kehn
bmem); BIO_set_flags(bio, BIO_FLAGS_BASE64_NO_NL); : fixed the problem. Regards, ...doug --- On Thu, 5/20/10, Doug Kehn wrote: > From: Doug Kehn > Subject: Re: Base64 Decode Problem/Question > To: openssl-users@openssl.org > Date: Thursday, May 20, 2010, 3:37 PM > Hi Bruno, >

RE: Base64 Decode Problem/Question

2010-05-20 Thread Dave Thompson
> From: owner-openssl-us...@openssl.org On Behalf Of Bruno Vetel > Sent: Thursday, 20 May, 2010 13:44 > Doug Kehn writes: > \n is not base64. Try with echo -n > > I'm trying to decode a base64 encoded string. The problem > I'm running in to is that BIO_read()

Re: Base64 Decode Problem/Question

2010-05-20 Thread Doug Kehn
Hi Bruno, --- On Thu, 5/20/10, Bruno Vetel wrote: > From: Bruno Vetel > Subject: Re: Base64 Decode Problem/Question > To: openssl-users@openssl.org > Date: Thursday, May 20, 2010, 1:43 PM > Doug Kehn > writes: > > > Hi All, > > > Hi > > \n is not

Re: Base64 Decode Problem/Question

2010-05-20 Thread Bruno Vetel
Doug Kehn writes: > Hi All, > Hi \n is not base64. Try with echo -n Bruno > I'm trying to decode a base64 encoded string. The problem I'm running in to > is that BIO_read() always returns 0. BIO_should_retry() and > BIO_should_read() also return 0 when BIO_

Base64 Decode Problem/Question

2010-05-20 Thread Doug Kehn
Hi All, I'm trying to decode a base64 encoded string. The problem I'm running in to is that BIO_read() always returns 0. BIO_should_retry() and BIO_should_read() also return 0 when BIO_read() returns 0. If the base64 encoded string is shortened, BIO_read returns the decoded i

Base64 Decode Problem

2010-05-20 Thread Doug Kehn
Hi All, I'm trying to decode a base64 encoded string. The problem I'm running in to is that BIO_read() always returns 0. BIO_should_retry() and BIO_should_read() also return 0 when BIO_read() returns 0. If the base64 encoded string is shortened, BIO_read returns the decoded infor

Re: base64 filter fails "only" with memory BIO but works with other BIOs

2009-10-05 Thread Srirang Doddihal
he eof behavior that is causing this problem I > tried > > reading directly from the memory bio without making this call : > > BIO_set_mem_eof_return(bio, 0). I could successfully read the base64 > data > > present in the mem bio and in the next call to read all the paramet

Re: base64 filter fails "only" with memory BIO but works with other BIOs

2009-10-05 Thread Dr. Stephen Henson
a should work. But it doesn't. > > Here is the code: http://pastebin.ca/1594435 > > To verify that it is the eof behavior that is causing this problem I tried > reading directly from the memory bio without making this call : > BIO_set_mem_eof_return(bio, 0). I could successfull

Re: base64 filter fails "only" with memory BIO but works with other BIOs

2009-10-05 Thread Srirang Doddihal
is problem I tried reading directly from the memory bio without making this call : BIO_set_mem_eof_return(bio, 0). I could successfully read the base64 data present in the mem bio and in the next call to read all the parameters were appropriately set to indicate that I should stop reading, namely:

Re: base64 filter fails "only" with memory BIO but works with other BIOs

2009-10-05 Thread Dr. Stephen Henson
On Mon, Oct 05, 2009, Srirang Doddihal wrote: > Hi all, > > I have some base64 encoded data in my own buffer (a character array). > I want to decode this. > > >From the man pages it appeared to me that I should > 1) create a memory bio, > 2) populate it with my base6

base64 filter fails "only" with memory BIO but works with other BIOs

2009-10-05 Thread Srirang Doddihal
Hi all, I have some base64 encoded data in my own buffer (a character array). I want to decode this. >From the man pages it appeared to me that I should 1) create a memory bio, 2) populate it with my base64 encoded data. 3) Create a base64 filter bio 4) Create a chain like this: [base64_

base64 filter fails "only" with memory BIO but works with other BIOs

2009-10-04 Thread Srirang Doddihal
Hi all, I have some base64 encoded data in my own buffer (a character array). I want to decode this. >From the man pages it appeared to me that I should 1) create a memory bio, 2) populate it with my base64 encoded data. 3) Create a base64 filter bio 4) Create a chain like this: [base64_

Re: OpenSSL C example Base64 Decode,

2009-09-04 Thread Hazel John
This works for me: void base64Decode(unsigned char* pIn, int inLen, unsigned char* pOut, int& outLen) { // create a memory buffer containing base64 encoded data BIO* bmem = BIO_new_mem_buf((void*)pIn, inLen); // push a Base64 filter so that reading from buffer decode

OpenSSL C example Base64 Decode,

2009-09-04 Thread Nigel Sollars
HI all, I have a working example of Encoding base64 using the BIO methods but decrypting a string is being somewhat problematic. The code in the man page for decoding does not work either as the stdin new_fp does not hand off / stop listening for input. The openssl version is 0.9.8i If

Re: Base64-encoded public key convert to PEM

2009-07-29 Thread Dr. Stephen Henson
On Tue, Jul 28, 2009, Bizhan Gholikhamseh (bgholikh) wrote: > > > > HI ALL, > > I have a binary format of a public key which is in > > "BASE64-encoded public key in RSA PKCS#1 format". > > How could I convert that to a PEM format? > > > Here

RE: Base64-encoded public key convert to PEM

2009-07-28 Thread Bizhan Gholikhamseh (bgholikh)
> HI ALL, > I have a binary format of a public key which is in > "BASE64-encoded public key in RSA PKCS#1 format". > How could I convert that to a PEM format? > Here is another data set: TO get the binary format I ran the following command: openssl asn1parse -inform

Base64-encoded public key convert to PEM

2009-07-28 Thread Bizhan Gholikhamseh (bgholikh)
HI ALL, I have a binary format of a public key which is in "BASE64-encoded public key in RSA PKCS#1 format". How could I convert that to a PEM format? Many thanks in advance, Bizhan __ OpenS

Re: base64 decoding using an s_mem chain

2009-01-11 Thread Ger Hobbelt
its chain on top of BIO_mem fetches that data from the BIO_mem source/sink again (which is thus used as an intermediate buffer store). As the BIO_read tries to read as many bytes ('inlen') as there currently are in BIO_mem 'raw storage', this will run into an 'EOF' signa

Re: base64 decoding using an s_mem chain

2009-01-01 Thread Michael S. Zick
On Thu January 1 2009, Frank B. Brokken wrote: > Hi Mike, > > Thanks for your postings in reply to my base64 decoding problem. I must admit > that I saw your first posting only after sending out the reply to William, so > let's correct that here :-) > > In your last pos

Re: base64 decoding using an s_mem chain

2009-01-01 Thread Frank B. Brokken
Hi Mike, Thanks for your postings in reply to my base64 decoding problem. I must admit that I saw your first posting only after sending out the reply to William, so let's correct that here :-) In your last posting you wrote: > Are you stripping the bytes that might appear in the strea

Re: base64 decoding using an s_mem chain

2008-12-31 Thread Michael S. Zick
On Wed December 31 2008, Frank B. Brokken wrote: > Hi William, > > Thanks for your reply. I followed your suggestion and changed the buffer size > to 480: where the original program shows `500' it now has > `480'. Unfortunately, after uncommenting the `Doesn't work' section the > problem remains.

Re: base64 decoding using an s_mem chain

2008-12-31 Thread Frank B. Brokken
Hi William, Thanks for your reply. I followed your suggestion and changed the buffer size to 480: where the original program shows `500' it now has `480'. Unfortunately, after uncommenting the `Doesn't work' section the problem remains. Only the first block is decoded. Since 480 clearly fits the r

RE: base64 decoding using an s_mem chain

2008-12-30 Thread William Bai
Since base64 regroups the original 8-bits based binary into groups of 6 bits for encoding, using padding as needed. So each original 8 bits is shared by two 6 bits, it is like a chain. To make your code work, you have to find out the exact point, where a 8 bit is not shared. For example

Re: base64 decoding using an s_mem chain

2008-12-30 Thread Michael S. Zick
-> 3*8bit function) - So your read function must either guarantee that a full records (4*x) have been read or somehow handle the excess 1 - 3 octets as the first part of the next read. For a general purpose function, it is probably a poor idea to expect the input to have line breaks (althoug

base64 decoding using an s_mem chain

2008-12-30 Thread Frank B. Brokken
trying to decode a base64 encoded file which is filtered through a BIO_s_mem method. My intention is to write a function in which the actual decoding is decoupled from the source of the encoded information as well as from the destination of the decoded info, and so I thought of using a BIO_s_mem me

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 b

Re: [Base64 Decoding] Bug when decoding??

2008-05-24 Thread karim Bendadda
o set the > flag > BIO_FLAGS_BASE64_NO_NL. See enc and BIO_f_base64() documents. I don't > normally > use EVP for base64 encoding, I use a bio chain so don't know about that. > > Steve. > -- > Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage > Ope

Re: [Base64 Decoding] Bug when decoding??

2008-05-23 Thread Dr. Stephen Henson
the BIO equivalent is to set the flag BIO_FLAGS_BASE64_NO_NL. See enc and BIO_f_base64() documents. I don't normally use EVP for base64 encoding, I use a bio chain so don't know about that. Steve. -- Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage OpenSSL project core develo

Re: [Base64 Decoding] Bug when decoding??

2008-05-23 Thread karim Bendadda
May 22, 2008, karim Bendadda wrote: > > > Hi All, > > > >I'm trying to decode a Base64 encoded string. Using the openssl > decoding > > command:* > > > > echo > > > "nnnKZdKOQMmVpLEOBqNU3L07ELMSoQxW0z7SvgZBmwXpjvMYPqnSMaWy9vu6NFUHGc40nhLbaFe8

Re: [Base64 Decoding] Bug when decoding??

2008-05-23 Thread karim Bendadda
Thanks for examples Victor. As Dominique suggests I tried to split the base64 encoded string to blocs. The decoding works fine now! but I still have some decrypting problems...I'll post my problem on a new topic; it concerning decrypting now!. Thank you for your help! On Thu, May 22, 20

Re: [Base64 Decoding] Bug when decoding??

2008-05-22 Thread Dr. Stephen Henson
On Thu, May 22, 2008, karim Bendadda wrote: > Hi All, > >I'm trying to decode a Base64 encoded string. Using the openssl decoding > command:* > > echo > "nnnKZdKOQMmVpLEOBqNU3L07ELMSoQxW0z7SvgZBmwXpjvMYPqnSMaWy9vu6NFUHGc40nhLbaFe8vI159nZHHdMOssHyfI6kz

Re: [Base64 Decoding] Bug when decoding??

2008-05-22 Thread Victor Duchovni
On Thu, May 22, 2008 at 02:20:07PM +0200, karim Bendadda wrote: > Hi All, > >I'm trying to decode a Base64 encoded string. Using the openssl decoding > co

Re: [Base64 Decoding] Bug when decoding??

2008-05-22 Thread Dominique Lohez
he command openssl enc -base64 -d -in essai.pem works. but be carefull most of the characterare not printables karim Bendadda a écrit : Hi All, I'm trying to decode a Base64 encoded string. Using the openssl decoding

Re: [Base64 Decoding] Bug when decoding??

2008-05-22 Thread karim Bendadda
return buffer; } * -- On Thu, May 22, 2008 at 3:57 PM, Dominique Lohez <[EMAIL PROTECTED]> wrote: > Hello karim > The line must be at most 64 octets long > using the file essai.pem where the unique has been splited in three > the command > > openssl enc -base64 -d -in essai.pem &

Re: [Base64 Decoding] Bug when decoding??

2008-05-22 Thread Dominique Lohez
Hello karim The line must be at most 64 octets long using the file essai.pem where the unique has been splited in three the command openssl enc -base64 -d -in essai.pem works. but be carefull most of the characterare not printables karim Bendadda a écrit : Hi All, I'm tryi

[Base64 Decoding] Bug when decoding??

2008-05-22 Thread karim Bendadda
Hi All, I'm trying to decode a Base64 encoded string. Using the openssl decoding command:* echo "nnnKZdKOQMmVpLEOBqNU3L07ELMSoQxW0z7SvgZBmwXpjvMYPqnSMaWy9vu6NFUHGc40nhLbaFe8vI159nZHHdMOssHyfI6kzXljRolfrSX6bNjcMvfy7k5J+2xo451u=" | openssl enc -base64 -d *I got no result! noth

Re: How to convert base64 encoded char buffer to X509

2008-04-11 Thread Dr. Stephen Henson
On Thu, Apr 10, 2008, Mohd Saleem wrote: > Hi , > > I have char buffer in base64 encoded format. The client should read the > buffer, decode it and get the result in X509 structure, i am facing issues > with this. > I am getting an error, error:0D06

Re: How to convert base64 encoded char buffer to X509

2008-04-10 Thread Dr. Stephen Henson
On Thu, Apr 10, 2008, Mohd Saleem wrote: > Hi , > > I have char buffer in base64 encoded format. The client should read the > buffer, decode it and get the result in X509 structure, i am facing issues > with this. > I am getting an error, error:0D06

How to convert base64 encoded char buffer to X509

2008-04-10 Thread Mohd Saleem
Hi , I have char buffer in base64 encoded format. The client should read the buffer, decode it and get the result in X509 structure, i am facing issues with this. I am getting an error, error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag. Could you help me in resolving this. Any

Re: PEM_read_bio:bad base64 decode:pem_lib.c

2008-01-31 Thread John T. Cox
56:error:0906D064:PEM routines:PEM_read_bio:bad base64 > decode:pem_lib.c:753: > > No references in google for this particular message. > Any help appreciated > __ > OpenSSL Project http://www.

PEM_read_bio:bad base64 decode:pem_lib.c

2008-01-28 Thread Artur Jasowicz
I am trying to decrypt a private key and am running into following error: $ openssl rsa -in my.key -out my.key.dec unable to load Private Key 28356:error:0906D064:PEM routines:PEM_read_bio:bad base64 decode:pem_lib.c:753: No references in google for this particular message. Any help

BIO_read and base64 problems

2007-11-09 Thread Giovanni Ferrari
Goodmorning, i'm trying to write an easy program to test the base64 BIO filter but it seems it doesn't work. In particular if i push the bio64, i read a little amount of data and i pop the bio64 the read in the middle fail ( return 0 ). This doens't happen if the text to read is a

0.9.7 & DES & Base64

2007-11-07 Thread openssl
Hello all, Hoping someone can help me here. I have this function that I use to do DES and Base64 encryption/encoding/decryption/decoding. When it links against libcrypto.0.9 it works fine. However when I rebuild it against libcrypto.0.9.7 it doesn't work. It encrypts but when

Re: Base64 encoding with BIO_new_mem_buf

2007-07-13 Thread Jim Fox
One other issue though the base64 encoded string contains new line character at the end. is there a way through the api to not include it. It is characteristic of openssl to insert linebreaks in both base64 and PEM encodings --- and to require them when it decodes data. If for some

Re: Base64 encoding with BIO_new_mem_buf

2007-07-13 Thread k b
One other issue though the base64 encoded string contains new line character at the end. is there a way through the api to not include it. From: "k b" <[EMAIL PROTECTED]> Reply-To: openssl-users@openssl.org To: openssl-users@openssl.org Subject: Re: Base64 encoding with BIO_

Re: Base64 encoding with BIO_new_mem_buf

2007-07-12 Thread k b
that was indeed the problem, a read only buffer. Thanks Jim ! From: Jim Fox <[EMAIL PROTECTED]> Reply-To: openssl-users@openssl.org To: openssl-users@openssl.org Subject: Re: Base64 encoding with BIO_new_mem_buf Date: Thu, 12 Jul 2007 11:21:28 -0700 (PDT) And yeah even with the c

Re: Base64 encoding with BIO_new_mem_buf

2007-07-12 Thread Jim Fox
And yeah even with the correct size it still doesn't work. The BIO_new_mem_buf creates a read-only buffer. If you want to write to memory use bio = BIO_new(BIO_s_mem()); and use BIO_get_mem_ptr to get a pointer to the buffer. Jim

Re: Base64 encoding with BIO_new_mem_buf

2007-07-12 Thread k b
); printf("[%s]\n", enc); } And yeah even with the correct size it still doesn't work. here's the output i get from all the printfs $./a.out Bytes Written 4, (null) [] $ From: Jim Fox <[EMAIL PROTECTED]> Reply-To: openssl-users@openssl.org To: openssl-users@opens

Re: Base64 encoding with BIO_new_mem_buf

2007-07-12 Thread Jim Fox
But what i really want is the encoded string in a char buffer. And so i comment out 2 and use 1 instead. As its suppose to write the encoded string into a buffer, but the problem here is pEncBuf is empty even though bytesWritten says it wrote 4 bytes. And i can't explain why it won'

Base64 encoding with BIO_new_mem_buf

2007-07-12 Thread k b
Hi, I'm trying to use BIO to do base64 encoding. but here's the problem in the sample code below, if I comment out like <<<< 1 (which uses mem bio) and uncomment <<<<2 (one that uses file bio) everything works and the encoded string is written the std out.

Re: openssl base64 routines

2006-11-22 Thread Dr. Stephen Henson
On Wed, Nov 22, 2006, Ambarish Mitra wrote: > Hi all, > > Is there some API functions to base64 encode and decode strings? > > I saw that "base64" command is supported in openssl, (openssl base64 > [options]), but I could not find any functions that I can cal

openssl base64 routines

2006-11-22 Thread Ambarish Mitra
Hi all, Is there some API functions to base64 encode and decode strings? I saw that "base64" command is supported in openssl, (openssl base64 [options]), but I could not find any functions that I can call in my C, C++ application programs. Please guide. Best regards

  1   2   >