Jump to content

Simple encryption without using mcrypt


SCook

Recommended Posts

Hi gang,

 

I've gotten some help with mcrypt, and I appreciate it, but it appears that the server I'm using doesn't have it installed.  Is there any other way, or does anyone have a simple encryption method?  A text jumble or converting letters to numbers or anything?  I just want to throw off those who view the query string is all.

Link to comment
Share on other sites

for a normall user this is ok as long they dont no php but if your updating

from ur link please conact the admin ok.

<?php
$message="hi there i am redarrow";

$encoded=base64_encode($message);

echo " encoded: <br><br> $encoded <br>";

$decodded=base64_decode($encoded);

echo "<br> decoded: <br><br> $decodded <br> ";

?>

 

ps.

 

you can use md5 but md5 can not be decoded ok.

Link to comment
Share on other sites

I would submit to you that anyone who is savvy enough to attempt tampering with your query strings will not be put off by a simple "Caesar Cipher" type encryption attempt (or encoding in another base).  I feel like your time would be better spent validating data sent in on the server side instead of burning cycles implementing a trivial obfuscation scheme.

 

Best,

 

Patrick

Link to comment
Share on other sites

You're right, Patrick, but there's an old saying "Locks are only to keep the honest people out."  Essentially, this is to throw off anyone who might like to look over someone's shoulder while their password or username is being verified.  It's not menat to be super secure, really, so this would be an ok fix.

Link to comment
Share on other sites

If you wanted to get really ghetto/weird with it and be a little more secure you could do something like:

 

$str = "YOUR STRING";
$r = rand(1,10);
$marker_length = 2;

for($i = 0; $i < $r; $i++) {
$str = base64_encode($str);
}

while(strlen($r) < $marker_length) {
$r = "0" . "{$r}";
}

$str .= $r . $str;

 

It would be very weird, and I don't know what kind of performance hit you would get from it, but if worst came to worst it would be decent.

Link to comment
Share on other sites

You're right, Patrick, but there's an old saying "Locks are only to keep the honest people out."  Essentially, this is to throw off anyone who might like to look over someone's shoulder while their password or username is being verified.  It's not menat to be super secure, really, so this would be an ok fix.

 

I see.  In that case why not just send that kind of data via POST instead of in the query string?

 

 

Patrick

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.