SEO Forums















                                          
User   Password   remember     (register)  ?

How to crypt and decrypt ?


Back to php.


thibault    (2009-04-10)

thibault

How to crypt and decrypt ?

Every programmer at least once look for a good way to encrypt with the possibility to decrypt. Md5 and Sha1 are not convenient in this case as it is not possible to decrypt with these functions.

Here are nice functions that will help you to encrypt and decrypt with a key :

<?

function encrypt($string, $key)
{
$string = 'STT576PWZA'.$string;

$result = '';
for($i=0; $i<strlen($string); $i++)
{
$char = substr($string, $i, 1);
$keychar = substr($key, ($i % strlen($key))-1, 1);
$char = chr(ord($char)+ord($keychar));
$result.=$char;
}

return base64_encode($result);
}

function decrypt($string, $key)
{
$result = '';
$string = base64_decode($string);

for($i=0; $i<strlen($string); $i++)
{
$char = substr($string, $i, 1);
$keychar = substr($key, ($i % strlen($key))-1, 1);
$char = chr(ord($char)-ord($keychar));
$result.=$char;
}

$result = substr($result,10,strlen($result));

return $result;
}

?>


Note that here the string to encrypt is added to 10 characters, this may not be useful but it is just a way to add kind of salt.

It works fine anyway !


ficgs
Suggestions

  Crypt decrypt password [Archive] - CodingForums.com
www.codingforums.com/archive/index.php/t-80996.html

  I need crypt and decrypt basic sample - ASP.NET Security
www.justskins.com/forums/i-need-crypt-and-decrypt-basic-sample-37506.html

 Projects tagged ‘crypt’ and ‘decryption’ - Ohloh
www.ohloh.net/tags/crypt/decryption

  crypt and decrypt IP address for a php project
mail.python.org/pipermail/python-list/2004-June/264805.html

 Delphi tip#172: to crypt/decrypt the file using Crypt API
www.scalabium.com/faq/dct0172.htm

 crypt -- encryption/decryption filter
www.mkssoftware.com/docs/man1/crypt.1.asp

 FULL POSTER SNIPS: Javascript Make A Tabula Recta Matrix. Crypt And Decrypt With Vigenere Cipher (Programming Javascript)
www.fullposter.com/snippets.php?snippet=112



ficgs
More suggestions

This is a collaborative page, you may change the order of these suggestions by registering, then clicking the icons before the titles.


 crypt and decrypt IP address for a php project
www.velocityreviews.com/forums/t331615-crypt-and-decrypt-ip-address-for-a-p

 crypt and decrypt a string - ObjectMix Forum
objectmix.com/php/440524-crypt-decrypt-string.html

 » Free Crypt decrypt php script
www.findmysoft.com/scripts/crypt_decrypt_php_script/

 Download Cryptofile 1.0 for PalmOS - Cryptofile - Crypt and decrypt file on external cards (m500, 505). - Softpedia
handheld.softpedia.com/get/Security/Encryption/Cryptofile-38451.shtml

 Download Crypt & Decrypt zip for free at Uploading.com
uploading.com/files/QF6UOVPM/Crypt

  Xor for decrypt/crypt in 6 lignes - GSM-Forum
forum.gsmhosting.com/vbb/showthread.php?t=716226

 Decrypt Files - Take care of your security!! digitally sign, crypt and decrypt your files The quick encryption and decryption files of any type
www.filesland.com/companies/FileEncryption-org/decrypt-files.html

 Free kriptirnik file crypt akte krypta protect encrypt decrypt Download - kriptirnik file crypt akte krypta protect encrypt decrypt Software
wareseeker.com/free-kriptirnik-file-crypt-akte-krypta-protect-encrypt-decry

 Perl Guru Forums: Perl Programming Help: Beginner: Can not Crypt::RSA->decrypt... :(
perlguru.com/gforum.cgi?post=32678;guest=3735055

 File Decrypt Soft: WinXAR, Stealth Files, MEO File Encryption Software, File Crypt, ...
www.softplatz.com/software/file-decrypt/

 OraFAQ Forum: SQL & PL/SQL => Crypt and Decrypt Fileds
www.orafaq.com/forum/t/72247/0/

 New Crypt & Decrypt - Sat-Television.com - Satellite Encryption
www.sat-television.com/showthread.php?p=194856

 Crypt - Decrypt AES Formular
www.stermon.com/temp/aes/crypt_decrypt_form.htm

 Crypt some text and Decrypt it : Crypt, Decrypt
www.experts-exchange.com/Programming/Languages/.NET/Visual_CSharp/Q_2417526

 File Crypt - File Crypt is freeware program for file protect. File Crypt encrypt/decrypt file with strong encryption.
www.sharewareconnection.com/file-crypt.htm

 Encryption / decryption programs
garbo.uwasa.fi/pc/crypt.html

 File Crypt - Free software downloads and reviews - CNET Download.com
download.cnet.com/File-Crypt/3000-2092_4-10702911.html

 l-crypt.el --- cmail with mailcrypt 3.4 or later ;;; ;;; Copyright (C) 1997 Toshihiko Ueki ;;; ;;; Author: Toshihiko Ueki ;;; Created: 1997/04/...
cvs.sourceforge.jp/cgi-bin/viewcvs.cgi/cmail/src/cmail-crypt.el?view=co

 Download Decryption Software: File Crypt, Polar Crypto Light Free, CommuniCrypt Mail, ...
www.filebuzz.com/files/decryption/2.html

 ASPN : Crypt::ECB 1.1
aspn.activestate.com/ASPN/CodeDoc/Crypt-ECB/ECB.html

 ::CBC; use MD5; use Carp; use strict; use vars qw($VERSION); $VERSION = '1.32'; sub new ($$;$) { my $class = shift; my ($key,$ciph...
www.zoneedit.com/doc/partner/Crypt/CBC.pm

  Crypt / Decrypt .NET configuration files - Vista Forums
www.vistax64.com/powershell/103289-crypt-decrypt-net-configuration-files.ht

 crypt.xhead Resources | TechRepublic
search.techrepublic.com.com/search/crypt.xhead.html

 Nabble - OpenSC - User - Question about extract_key() function in pkcs15-crypt.c
www.nabble.com/Question-about-extract_key()-function-in-pkcs15-crypt.c-td20

 Download Decrypt File Software: Stealth Files, Dekart Secrets Keeper, File Crypt, PDF Password Recovery COM SDK
www.bluechillies.com/list/decrypt-file.html



Response  
  Smilies

Guest name   (optional)       Register for more options.



Trackbacks : If you talked about this article in your blog or website, you may instantly get a backlink 
  There's no trackback at the moment.









 

FICGS message




SEO forums and chat - Search engines optimization



 

March 20, 2010

 

Buttons: Facebook, Twitter, MySpace, Google, Technorati, Yahoo buzz... Ficgs Facebook Myspace Twitter Google Technorati Stumble upon Delicious Digg Yahoo buzz Wikio Furl Reddit Linkedin Squidoo Newsvine Yahoo My Web Blogmarks Comments Blinklist Email

You comment I follow : Links included in comments will be "dofollow" if your post is not an obvious spam, comments are published instantly.


Write upside down to your contacts !
(works with Facebook, Twitter, MSN, Yahoo, MySpace, Hi5, Bebo, Youtube...)







FICGS is also a Free Internet Correspondence Games Server.

Here you can play Chess, Go & Poker Texas Holdem online for free in rated class tournaments and a unique world championship.

Free Internet Chess & Go Server


Feel free to link to FICGS :