Package com.ikanow.infinit.e.data_model.utils

Source Code of com.ikanow.infinit.e.data_model.utils.TextEncryption

/*******************************************************************************
* Copyright 2012, The Infinit.e Open Source Project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
package com.ikanow.infinit.e.data_model.utils;

import org.jasypt.util.text.BasicTextEncryptor;

public class TextEncryption {
  // Basic Text Encryptor Object
  private static BasicTextEncryptor encryptor = null;
  // Encryptor Password String
  private String entryptorPassword = "infinit.e";
 
  /**
   *  Constructor for password encryption class
   */
  public TextEncryption() {
    encryptor = new BasicTextEncryptor();
    encryptor.setPassword(entryptorPassword);           // we HAVE TO set a password

  }
  /**
   *  Encrypt the password
   */
  public String encrypt(String password) {
    return encryptor.encrypt(password);
  }
  /**
   *  Decrypting the password
   */
  public String decrypt(String password) {
    return encryptor.decrypt(password);
  }

}
TOP

Related Classes of com.ikanow.infinit.e.data_model.utils.TextEncryption

TOP
Copyright © 2018 www.massapi.com. 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.