Package edu.uiuc.ncsa.security.util.pkcs
Class EncryptionUtil
- java.lang.Object
-
- edu.uiuc.ncsa.security.util.pkcs.EncryptionUtil
-
public class EncryptionUtil extends Object
Utility to password protect files. This takes a password and any text and password protects it. The longer the password, the better the protection.Usage
encrypt - returns an encrypted text with header. isEncrypted - checks if the argument has been encrypted with this utility Don't call decrypt without this decrypt - returns unencrypted contents.Note
This requires a password and a string to be encrypted. The longer the password, the better the protection.Created by Jeff Gaynor
on 7/19/21 at 9:52 AM
-
-
Field Summary
Fields Modifier and Type Field Description static String
PASSWORD_HEADER
-
Constructor Summary
Constructors Constructor Description EncryptionUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
decrypt(String encoded, String password)
static String
encrypt(String text, String password)
static boolean
isEncrypted(String text)
static void
main(String[] args)
-
-
-
Field Detail
-
PASSWORD_HEADER
public static String PASSWORD_HEADER
-
-
Method Detail
-
main
public static void main(String[] args) throws IllegalAccessException
- Throws:
IllegalAccessException
-
decrypt
public static String decrypt(String encoded, String password) throws IllegalAccessException
- Throws:
IllegalAccessException
-
isEncrypted
public static boolean isEncrypted(String text)
-
-