Security and Cryptography
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationSecurity and Cryptography

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old March 31st, 2008, 10:25 AM
BananaMaster BananaMaster is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Posts: 19 BananaMaster User rank is Sergeant (500 - 2000 Reputation Level)BananaMaster User rank is Sergeant (500 - 2000 Reputation Level)BananaMaster User rank is Sergeant (500 - 2000 Reputation Level)BananaMaster User rank is Sergeant (500 - 2000 Reputation Level)BananaMaster User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 13 h 47 m 51 sec
Reputation Power: 0
Hcrypt - A simple to use PHP encryption

Ok,

As you see in one of the other threads in this category and it's a sticky I said about encrpyting encrpyted strings for more security but then you could just have a list of them so I have created a simple PHP script for your use that encrypts encypted strings but using diffrent encryption functions eg. MD5, sha1 and crypt and then having your own defined strings that will influence the encryption thus making it extremley difficult or maybe imposible for any decrpytion/cracking.

Here is the script:

PHP Code:
<?
//This is a test HCRYPT script
//Ofcourse HCRYPTing will take a little longer then normal crypting eg. just using md5() function
//This is ofcourse used to stop dictonary attacks


function hcrypt($data)
{
//This is the editable area, I recomend you edit this from the default values
$var1 "287"//!WARNING1! THESE MUST BE NUMBERS
$var2 "215"//!WARNING1! THESE MUST BE NUMBERS
$var3 "18"//!WARNING1! THESE MUST BE NUMBERS
$var4 "15"//!WARNING1! THESE MUST BE NUMBERS

//This bit doesn't need editing but you can if you wish
$letters1 = array(
"a",
"d",
"e",
"f",
"g",
"h",
"x",
"y",
"z"
);

$letters2 = array(
"k",
"l",
"m",
"c",
"n",
"o",
"p",
"q",
"r",
"s",
"t"
);

$letters3 = array(
"u",
"v",
"b",
"i",
"j",
"w",
);

$vars = ($var1-$var2)+($var3-$var4);

$thecrypt_hcrypt sha1(md5($vars.md5($data)));
$thecrypt_hcrypt str_ireplace($letters1"861"$thecrypt_hcrypt);  
$thecrypt_hcrypt str_ireplace($letters2"349"$thecrypt_hcrypt);  
$thecrypt_hcrypt str_ireplace($letters3"132"$thecrypt_hcrypt); 


$final crypt($thecrypt_hcrypt"salt");
return 
$final;
}
?>


Save it as hcrypt.php

Remember to modify the $var1, $var2, $var3 and $var4 strings.
it is easy to use just include the script and then use the function hcrypt()

Example

PHP Code:
<?
include"hcrypt.php";

echo 
hcrypt("hello, this is a test. Test123 etc.");
?>

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationSecurity and Cryptography > Hcrypt - A simple to use PHP encryption


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway