Java 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

StringencryptEmailId(String emailId)
Method to encrypt email id
char[] letters = emailId.toCharArray();
StringBuilder encriptedEmailId = new StringBuilder();
for (int index = 0; index < letters.length; index++) {
    int code = letters[index];
    encriptedEmailId.append((char) ((code * M_FACTOR) - S_FACTOR));
return encriptedEmailId.toString();
StringencryptIfNotEncrypted(String s)
encrypt If Not Encrypted
return isEncrypted(s) ? s : encrypt(s);
Stringencryption(String str, int k)
encryption
String string = "";
for (int i = 0; i < str.length(); i++) {
    char c = str.charAt(i);
    if (c >= 'a' && c <= 'z') {
        c += k % 26;
        if (c < 'a') {
            c += 26;
        if (c > 'z') {
            c -= 26;
    } else if (c >= 'A' && c <= 'Z') {
        c += k % 26;
        if (c < 'A') {
            c += 26;
        if (c > 'Z') {
            c -= 26;
    string += c;
return string;
intencryptPlayerChat(byte[] is, int i_25_, int i_26_, int i_27_, byte[] is_28_)
Encrypt player chat.
try {
    i_27_ += i_25_;
    int i_29_ = 0;
    int i_30_ = i_26_ << -2116795453;
    for (; i_27_ > i_25_; i_25_++) {
        int i_31_ = 0xff & is_28_[i_25_];
        int i_32_ = anIntArray233[i_31_];
        int i_33_ = aByteArray235[i_31_];
...
StringencryptPwd(String src)
Creates a new instance of FormulaEncrypt
char asciiarr[] = src.toCharArray();
int encryasciiarr[] = new int[src.length()];
String encrypt = "";
for (int i = 0; i < asciiarr.length; i++) {
    int asciichar = (int) asciiarr[i] + 2;
    int accharmul2 = asciichar * 2;
    encryasciiarr[i] = accharmul2;
for (int j = 0; j < encryasciiarr.length; j++) {
    encrypt = encrypt + "@" + encryasciiarr[j];
return encrypt;
StringencryptStrBuff(byte[] resultBytes)
encrypt Str Buff
StringBuffer strBuff = new StringBuffer();
for (int i = 0; i < resultBytes.length; i++) {
    if (Integer.toHexString(0xFF & resultBytes[i]).length() == 1) {
        strBuff.append("0").append(Integer.toHexString(0xFF & resultBytes[i]));
    } else {
        strBuff.append(Integer.toHexString(0xFF & resultBytes[i]));
return strBuff.toString();
StringencryptString(final String cadena)
Encriptar cadena.
String resultado = "";
for (int pos = 0; pos < cadena.length(); pos++) {
    if (pos == 0) {
        resultado = encryptChar(cadena.substring(pos, pos + 1), cadena.length(), pos);
    } else {
        resultado += encryptChar(cadena.substring(pos, pos + 1), cadena.length(), pos);
return resultado;
StringencryptString(String str)
encrypt String
StringBuffer sb = new StringBuffer();
for (int i = 0; i < str.length(); i++) {
    int c = str.charAt(i);
    sb.append(Integer.toHexString(c ^ key)).append(" ");
return sb.toString();
StringencryptString(String str)
encrypt String
return BASE64_ENCODER.encodeToString(str.getBytes());
StringencryptURID(long registrationId)
Method encrypt URID
char[] characters = String.valueOf(registrationId).toCharArray();
StringBuilder encryptedURID = new StringBuilder();
for (int index = 0; index < characters.length; index++) {
    int code = characters[index];
    char ch = (char) ((code * M_FACTOR) - S_FACTOR);
    encryptedURID.append(Integer.toHexString(ch));
    if ((index + 1) % 4 == 0) {
        encryptedURID.append("-");
...