Android Utililty Methods String Encrypt

List of utility methods to do String Encrypt

Description

The list of methods to do String Encrypt are organized into topic(s).

Method

Stringencrypt(String keyStr, String plainText)
encrypt
byte[] encrypt = null;
try {
    Key key = generateKey(keyStr);
    Cipher cipher = Cipher.getInstance(AESTYPE);
    cipher.init(Cipher.ENCRYPT_MODE, key);
    encrypt = cipher.doFinal(plainText.getBytes());
} catch (Exception e) {
    e.printStackTrace();
...
Stringencrypt(String seed, String cleartext)
encrypt
byte[] rawKey = getRawKey(seed.getBytes());
byte[] result = encrypt(rawKey, cleartext.getBytes());
return toHex(result);
Stringencrypt(String str)
encrypt
String key = "a12348a9gde";
StringBuilder sb = new StringBuilder();
try {
    byte[] data = str.getBytes("UTF-8");
    byte[] keyData = key.getBytes("UTF-8");
    for (int i = 0; i < data.length; i++) {
        String s = String.format("%02X", data[i] & 0xFF
                ^ keyData[i % keyData.length] & 0xFF);
...