Package com.im.imjutil.cipher

Examples of com.im.imjutil.cipher.Cipher


   */
  public static String decryptPassword(String password) {
    String pass = password;
    try {
      if (Validator.isValid(pass)) {
        Cipher cipher = Cipher.getInstance();
        byte[] coded = Base64Coder.decrypt(pass);
        pass = new String(cipher.decrypt(coded));
      }
    } catch (Exception e) {
      String error = "Erro ao decifrar a senha.";
      Logger.error(error, e);
      throw new ValidationException(error);
View Full Code Here


   */
  public static String encryptPassword(String password) {
    String pass = password;
    try {
      if (Validator.isValid(pass)) {
        Cipher cipher = Cipher.getInstance();
        byte[] coded = cipher.encrypt(pass.getBytes());
        pass = Base64Coder.encrypt(coded);
      }
    } catch (Exception e) {
      String error = "Erro ao cifrar a senha.";
      Logger.error(error, e);
View Full Code Here

TOP

Related Classes of com.im.imjutil.cipher.Cipher

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.