The following program will generate the random password.
import java.util.Random;
public class AutoPwdGenerator {
public String gen8DigitPwd()
{
String strPassword="";
try{
Random randomPassword = new Random();
int i=randomPassword.nextInt(10);
int j = randomPassword.nextInt(100);
int k = randomPassword.nextInt(100);
int l = randomPassword.nextInt(10);
int m = randomPassword.nextInt(10);
strPassword=i+"T"+j+k+"P"+l;
System.out.println("Auto generated password"+strPassword);
}catch(Exception e)
{
e.printStackTrace();
}
return strPassword;
}
}
public class AutoPwdGeneratorTest
{
public static void main(String args[])
{
AutoPwdGenerator autoGen = new AutoPwdGenerator();
String randomPwd = autoGen.gen8DigitPwd();
System.out.println("Generated Random Password:"+randomPwd);
}
}
Header Ad
Showing posts with label Magento Password. Show all posts
Showing posts with label Magento Password. Show all posts
Tuesday, April 27, 2010
Thursday, April 1, 2010
Magento Customer Password Encryption
Magento follows the below steps to encrypt the password. This encypted passowrd will be stored in the database.
Let suppose your password will be "test123". Magento will add auto generated slot variable for this password. Let the auto-generated slot is "BJ".
The following is code for generating the hash.
echo Mage::helper('core')->getHash('test123', 'BJ');
Printed variable is the one stroed in the database.
Let suppose your password will be "test123". Magento will add auto generated slot variable for this password. Let the auto-generated slot is "BJ".
The following is code for generating the hash.
echo Mage::helper('core')->getHash('test123', 'BJ');
Printed variable is the one stroed in the database.
Subscribe to:
Posts (Atom)