0

I would like to create a custom algorithm for encrypting and decrypting strings of data. I want the algorithm to allow two parameters:

  1. Custom salt string for the algorithm to use to create custom encrypted strings of the data.
  2. The data to be encrypted / decrypted.

I don't want to use any php set functions cause they are crackable. I want to learn how to create a custom algorithm from scratch and custom code.

Thanks for any help.

3
Contributors
2
Replies
5
Views
5 Years
Discussion Span
Last Post by diafol
0
<?php
$password="RimoRocks";
$salt="YesForSure";
$encryptedPassword=crypt($password,$salt);
// SQL Stuff: extract password from database and save to $passwordFromDatabase here
if($passwordFromDatabase==$encryptedPassword)
{
   // passwords match
}
else
{
  // passwords do not match
}
?>

Simplest way ... to make your script,
you can create few levels encrypt
for example first step can be $md5pass = md5($pass) second $encryptpass = crypt($md5pass, $salt)

Regards
Rimo

Edited by Rimotevst: upate

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.