Professional Documents
Culture Documents
import java.security.*;
import java.security.spec.InvalidKeySpecException;
import java.util.Scanner;
import javax.crypto.*;
import javax.crypto.spec.SecretKeySpec;
import sun.misc.*;
Cipher c = Cipher.getInstance(ALGO);
c.init(Cipher.ENCRYPT_MODE, key);
return encryptedValue;
}
public static String decrypt(String encryptedData) throws Exception {
Cipher c = Cipher.getInstance(ALGO);
c.init(Cipher.DECRYPT_MODE, key);
return decryptedValue;
return key;
if(range1<1||range1 >100)
System.exit(0);
}
if(range2>range1)
System.exit(0);
else if(range2<1)
System.exit(0);
else
if(passenc.equals(passwordEnc))
else