-
1. Re: How to decrypt the password which was encrypted by picketBox
sfcoy Mar 30, 2012 6:16 AM (in response to yangguang)1 of 1 people found this helpfulEverything you need to know can be found in org.picketbox.datasource.security.SecureIdentityLoginModule
Isn't open source wonderful?
-
2. Re: How to decrypt the password which was encrypted by picketBox
yangguang Mar 30, 2012 6:32 AM (in response to sfcoy)Yes, thanks for help. I think I can investigate.
-
3. Re: How to decrypt the password which was encrypted by picketBox
chidrewar.rohit Nov 9, 2017 1:49 AM (in response to yangguang)Yes you can do this by ---->
/**
* @author Rohit
*
*/
public class DecodePassword{
public static void main(String[] args)
{
String value = null;
if (args.length < 0) {
System.out.println("Necessary arguments Not passed,Please Pass the Password To Decrypt");
} else {
value = args[0].toString().trim();
}
try
{
System.out.println(decode(value));
}
catch (Exception io)
{
io.printStackTrace();
}
}
public static char[] decode(String secret)
throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException
{
byte[] kbytes = "jaas is the way".getBytes();
SecretKeySpec key = new SecretKeySpec(kbytes, "Blowfish");
BigInteger n = new BigInteger(secret, 16);
byte[] encoding = n.toByteArray();
Cipher cipher = Cipher.getInstance("Blowfish");
cipher.init(2, key);
byte[] decode = cipher.doFinal(encoding);
return new String(decode).toCharArray();
}
}