Java String Encrypt encryptPwd(String src)

Here you can find the source of encryptPwd(String src)

Description

Creates a new instance of FormulaEncrypt

License

Open Source License

Declaration

public static String encryptPwd(String src) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 *
 * Project : Mirage V2/* w  w w.  j  av  a 2s  .c om*/
 *
 * Package :
 *
 * Date    :  September 19, 2007, 11:31 PM
 *
 * Author  : Praveen Kumar Ralla<pralla@miraclesoft.com>
 *
 * File    : EncriptDecriptPwd.java
 *
 * Copyright 2007 Miracle Software Systems, Inc. All rights reserved.
 * MIRACLE SOFTWARE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 * *****************************************************************************
 */

public class Main {
    /** Creates a new instance of FormulaEncrypt */
    public static String encryptPwd(String src) {
        //Converting String to array

        char asciiarr[] = src.toCharArray();

        //Finding lnegth and converting into int

        int encryasciiarr[] = new int[src.length()];

        String encrypt = "";

        for (int i = 0; i < asciiarr.length; i++) {
            // System.out.println("The origianl value are"+ (int)asciiarr[i]);
            int asciichar = (int) asciiarr[i] + 2;
            int accharmul2 = asciichar * 2;
            encryasciiarr[i] = accharmul2;

        }

        for (int j = 0; j < encryasciiarr.length; j++) {

            //System.out.println("The ascii char are"+encryasciiarr[j]);
            encrypt = encrypt + "@" + encryasciiarr[j];
        }

        // System.out.println("The enc is"+encrypt);

        return encrypt;
    }
}

Related

  1. EncryptDecrypt(String value)
  2. encryptEmailId(String emailId)
  3. encryptIfNotEncrypted(String s)
  4. encryption(String str, int k)
  5. encryptPlayerChat(byte[] is, int i_25_, int i_26_, int i_27_, byte[] is_28_)
  6. encryptStrBuff(byte[] resultBytes)
  7. encryptString(final String cadena)
  8. encryptString(String str)
  9. encryptString(String str)