Are you sure that those "unique characters" are individually there?
If you're writing in binary, it's likely that you have binary in the
file, and what "shows up" is your editor's valiant attempt to display
non-printable characters.

Try editing the file in emacs in hexl-mode and let emacs do the binary
to ascii conversion for you and show you what's there.

You could do a conversion to-from binary (sprintf, sscanf) if you want
to view the result for debugging, although I typically just let emacs
do it.  Aside from debugging, storing in binary should be fine.

> From: "Sheehan, Tim" <[EMAIL PROTECTED]>
> Date: Tue, 27 Sep 2005 18:23:27 -0300
> 
> I'm working in C.
> 
> I'm actually using the AES 256 algorithm. It has been bolted in
> to the SSL like DES(and other enc algs).  The encryption piece
> appears to be working well.  I can cipher&decipher without any
> issues.  It is when I store that encrypted string to a file. 
> The file being written is opened with fopen and then fwrite 
> and fread are used to write & read.  
> 
> When I write it out to the file is shows up in a binary format eq.
> 
> "\326\34368^H\316f]\234^E\371^C\342\246\217<d=\341?^R\310\237[>3^\:\236\241\
> 206\243"
> 
> Then when I am reading it back, the unique characters are interpreted
> incorrectly.
> T
> 
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of Adam Jones
> Sent: Tuesday, September 27, 2005 5:09 PM
> To: openssl-users@openssl.org
> Subject: RE: printing encrypted strings
> 
> 
> What type of encryption are you using? And what function are you using to
> print it out. I have used cout and it works fine with that. 
> 
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Sheehan, Tim
> Sent: Tuesday, September 27, 2005 3:46 PM
> To: 'openssl-users@openssl.org'
> Subject: printing encrypted strings
> 
> Hi,
> I am trying to store encrypted data into an ascii file.  
> The encrypted output appears to be in a binary format.  
> Are there SSL functions I should use to convert to an ascii format before
> moving it to the file?



-- 
Ken Goldman   [EMAIL PROTECTED]   914-784-7646
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to