Luigi Auriemma

aluigi.org (ARCHIVE-ONLY FORUM!)
It is currently 19 Jul 2012 11:54

All times are UTC [ DST ]





Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
 Post subject: encrypt a string
PostPosted: 26 Aug 2009 12:16 

Joined: 08 Jul 2009 05:55
Posts: 12
hello luigi,

i want to encrypt a string, i already used rsa for stringbuffer encryption, but now i need a method which creates no '\x00' in the output buffer, so that i can terminate the encrypted result with a '\x00'. Do you know any method to do this.

thx in advance


Top
 Profile  
 
 
 Post subject: Re: encrypt a string
PostPosted: 26 Aug 2009 15:49 

Joined: 13 Aug 2007 21:44
Posts: 4068
Location: http://aluigi.org
it's very simple, you need only to "encode" your sequence of bytes with an algorithm which uses a particular charset.
the 2 most simple and diffused encoding are:
- hexadecimal: if you have "\x01\x00\x34" it will become "010034"
- base64: if you have "\x01\x00\x34" it will become "AQA0"


Top
 Profile  
 
 Post subject: Re: encrypt a string
PostPosted: 01 Nov 2009 01:47 

Joined: 23 Aug 2007 23:06
Posts: 4
You could use yEnc encoding; it's used for sharing binaries on usenet. It escapes \x00 and has a lot less overhead then base64...

http://www.yenc.org


Top
 Profile  
 
 Post subject: Re: encrypt a string
PostPosted: 01 Nov 2009 01:52 

Joined: 13 Aug 2007 21:44
Posts: 4068
Location: http://aluigi.org
I have read about yenc just some days ago when I implemented it in my QuickBMS tool.
seems that it's a loved/hated algorithm, indeed it's often not suggested (as far as I have read).
technically instead I can only say that it's really a joke to implement because it's very very simple :)


Top
 Profile  
 
 Post subject: Re: encrypt a string
PostPosted: 01 Nov 2009 14:49 

Joined: 23 Aug 2007 23:06
Posts: 4
Yup, I recently implemented it as well because I was creating a .NZB downloader, it's quite easy to do.


Top
 Profile  
 
 Post subject: Re: encrypt a string
PostPosted: 13 Nov 2009 03:14 

Joined: 01 Sep 2008 07:40
Posts: 31
i wrote a "leecher" a little awhile ago and implemented yenc as well, works nicely


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

All times are UTC [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for: