How to encrypt output like this

Discussions of secure PHP coding. Security in software is important, so don't be afraid to ask. And when answering: be anal. Nitpick. No security vulnerability is too small.

Moderator: General Moderators

Post Reply
net1
Forum Newbie
Posts: 5
Joined: Mon Oct 17, 2005 9:41 am

How to encrypt output like this

Post by net1 »

Hi,

I would like to know how or what is method to generate output strings like this.

Code: Select all

KVS+c8R6ijLCMkTZp9ibSw==
If you know the method then if this can be decode or it only one-way encryption?

Thank you
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

That appears to be a base64_encode() result. base64_decode() will return it to "normal."
net1
Forum Newbie
Posts: 5
Joined: Mon Oct 17, 2005 9:41 am

Post by net1 »

Yes, it look like base64_encode but when I test with base64_decode it give unreadable text then I think it might be some method that using base64.
User avatar
Oren
DevNet Resident
Posts: 1640
Joined: Fri Apr 07, 2006 5:13 am
Location: Israel

Post by Oren »

net1 wrote:I think it might be some method that using base64.
Maybe.
User avatar
dreamscape
Forum Commoner
Posts: 87
Joined: Wed Jun 08, 2005 10:06 am
Contact:

Post by dreamscape »

It appears to be binary data that has been base64 encoded. If you convert it [the binary data] to hex, you get a 32 bit string, which could just be pure coincidence, or it could be a sign that it is the result of some 32 bit one-way encryption algorithm.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I believe dreamscape means a 32 nibble string, not bit.

Indeed the result is a 16 byte binary string, which converts to 32 nibbles. Likely a result of an MD5, or other 128 bit algorithm.
net1
Forum Newbie
Posts: 5
Joined: Mon Oct 17, 2005 9:41 am

Post by net1 »

Now I know that this string is the result of encryption from number 7200
User avatar
dreamscape
Forum Commoner
Posts: 87
Joined: Wed Jun 08, 2005 10:06 am
Contact:

Post by dreamscape »

feyd wrote:I believe dreamscape means a 32 nibble string, not bit.
Silly me... actually I meant a 32 byte hex string and 128 bit algo, not 32 bit string and 32 bit algo... I knew my brain felt a bit like pudding today. :P
Post Reply