16 Bit Encryption

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
zaibe
Forum Newbie
Posts: 6
Joined: Wed Mar 24, 2004 12:10 am

16 Bit Encryption

Post by zaibe »

Hello!

If any one knows any website or have any class or function which can encrypt string upto 16 bit (characters)...?

Thanx In Advance

zohaib.
User avatar
Slippy
Forum Contributor
Posts: 113
Joined: Sat Jul 12, 2003 11:31 pm
Location: Vancouver eh!

Post by Slippy »

The md5() function using "Raw_output" should produce a raw binary (16 bit) string.

Something like

Code: Select all

$out=md5($string, raw_output);
See http://www.php.net/manual/en/function.md5.php
zaibe
Forum Newbie
Posts: 6
Joined: Wed Mar 24, 2004 12:10 am

Post by zaibe »

i got this error when i use this function like you said

PHP Warning: Wrong parameter count for md5()

And also its wriiten on the site you told tht

The optional raw_output parameter was added in PHP 5.0.0 and defaults to FALSE
User avatar
Slippy
Forum Contributor
Posts: 113
Joined: Sat Jul 12, 2003 11:31 pm
Location: Vancouver eh!

Post by Slippy »

So, if you are not using php5, the md5 function still works -- just drop the raw_output part,

Of course, in that form it returns 32 bit HEX... is there an intended purpose behind the 16 bit requirement?
zaibe
Forum Newbie
Posts: 6
Joined: Wed Mar 24, 2004 12:10 am

Post by zaibe »

well, :) offcourse there is some purpose thts why i'm asking abt 16bit encryption....
If this is not any way for me then if you know any function in Javascript which can give me the required result?...

Like md5 in php and javascript produces same result co'z both are using same algo...

so is there is any possibilty like tht?
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Re: 16 Bit Encryption

Post by Roja »

zaibe wrote:Hello!

If any one knows any website or have any class or function which can encrypt string upto 16 bit (characters)...?

Thanx In Advance

zohaib.
Contrary to other comments, md5 is not encryption at all - its hashing/fingerprinting. See my tutorial on md5 here.

You'll need to be much more specific about what you want to accomplish. Does the string have a maximum length?
Do you need the output to be able to be un-encrypted?
Do you need the output to be 16 characters, or just 16 bytes, and why?

All of those will help pick between dozens of different encryption methods including mcrypt.

There is definitely a solution, but you need to be more clear about stating the problem to get your answer.
Post Reply