Fedora Linux Support Community & Resources Center
  #1  
Old 27th March 2005, 09:47 PM
cweng Offline
Registered User
 
Join Date: Oct 2004
Posts: 24
encrypt/decrypt a buffer in a C program

What function call can I use to encrypt and decrypt a buffer of 128 bytes in a C program ? The only requirement is that the buffer must be encrypted with ASCII code. Because I will printf the encrypted buffer and I want people to be able to cut and paste it. Thanks.
Reply With Quote
  #2  
Old 27th March 2005, 10:05 PM
Yatima Offline
Registered User
 
Join Date: Mar 2005
Location: Luxembourg
Age: 42
Posts: 20
Sounds like you want to encrypt, then hexdump.

Try "man 3 openssl" to get the possible C functions.

For example "man 3 blowfish" for blowfish encryption.

For the dump, roll your own or use for example "man BIO_f_base64" to learn about base64 encoding

Best luck.
Reply With Quote
  #3  
Old 27th March 2005, 10:32 PM
cweng Offline
Registered User
 
Join Date: Oct 2004
Posts: 24
Does blowfish encrypt the buffer with ASCII key ? Because I want to able to printf the whole encrypted buffer ...
Reply With Quote
  #4  
Old 27th March 2005, 10:48 PM
Yatima Offline
Registered User
 
Join Date: Mar 2005
Location: Luxembourg
Age: 42
Posts: 20
No, you have to separate these two problems.

Any encrypt/decrypt transform some byte array into another byte array. But to print, you can do
something simple like using printf("%x",array[i]) over the array.

Work with a byte array - then output using printf %x, transforming bytes to text.

Same the other way:

Input using scanf %x - then work with the byte array.
Reply With Quote
Reply

Tags
buffer, encrypt or decrypt, program

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
About to decrypt password satimis Programming & Packaging 1 30th May 2009 07:14 AM
GEdit Encrypt/Decrypt Plugin rldawson Using Fedora 1 27th December 2008 01:06 PM
KGpg don't want to decrypt my files linuxelu Security and Privacy 2 2nd December 2007 07:55 PM
How to decrypt files? Dunhausen Using Fedora 3 25th March 2006 02:13 PM
Encrypt/Decrypt a folder jacobsh Security and Privacy 6 16th February 2005 05:21 AM


Current GMT-time: 10:44 (Saturday, 25-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat