I need to implement a couple of functions which comply with the following:
function genKey: given a string q (this may be a MD5 or SHA hash) and a seed string, the function must generate a new string p
function checkKey: this function must return true if a string p was generated from string q (using the previous function)
In seudo-code the above would be something lie this:
p=genKey(q,seed) ; // generate string p from q and seed
checkKey(p,q)==true ; // if p was generated from q, then this must return true. False otherwise.
Does anyone know about existing algorithms that do such thing??
I can implement the algorithms myself if there are no known implementations for PHP, so what I'm really asking is for the procedure to accomplish this.