Package railo.runtime.crypt

Examples of railo.runtime.crypt.BlowfishEasy


  public static String decrypt(String str) {
    if (StringUtil.isEmpty(str) || !StringUtil.startsWithIgnoreCase(str, "encrypted:"))
      return str;
    str = str.substring(10);
    return new BlowfishEasy("sdfsdfs").decryptString(str);
  }
View Full Code Here


  public static String encrypt(String str) {
    if (StringUtil.isEmpty(str))
      return "";
    if (StringUtil.startsWithIgnoreCase(str, "encrypted:"))
      return str;
    return "encrypted:" + new BlowfishEasy("sdfsdfs").encryptString(str);
  }
View Full Code Here

    String hpw=railoConfiguration.getAttribute("pw");
    if(StringUtil.isEmpty(hpw)) {
      // old password type
      String pwEnc = railoConfiguration.getAttribute("password"); // encrypted password (reversable)
      if (!StringUtil.isEmpty(pwEnc)) {
        String pwDec = new BlowfishEasy("tpwisgh").decryptString(pwEnc);
        hpw=hash(pwDec);
      }
    }
    if(!StringUtil.isEmpty(hpw))
      config.setPassword(hpw);
    else if (configServer != null) {
      config.setPassword(configServer.getDefaultPassword());
    }
   
    if(config instanceof ConfigServerImpl) {
      ConfigServerImpl csi=(ConfigServerImpl)config;
      String keyList=railoConfiguration.getAttribute("auth-keys");
      if(!StringUtil.isEmpty(keyList)) {
        String[] keys = ListUtil.trimItems(ListUtil.toStringArray(ListUtil.toListRemoveEmpty(keyList, ',')));
        for(int i=0;i<keys.length;i++){
          keys[i]=URLDecoder.decode(keys[i], "UTF-8", true);
        }
       
        csi.setAuthenticationKeys(keys);
      }
    }
   
    // api key
    String apiKey = railoConfiguration.getAttribute("api-key");
    if(!StringUtil.isEmpty(apiKey))
      config.setApiKey(apiKey);
    else if(configServer != null)
      config.setApiKey(configServer.getApiKey());
    else
      config.setApiKey(null);
   
    // default password
    if (config instanceof ConfigServerImpl) {
      hpw=railoConfiguration.getAttribute("default-pw");
      if(StringUtil.isEmpty(hpw)) {
        // old password type
        String pwEnc = railoConfiguration.getAttribute("default-password"); // encrypted password (reversable)
        if (!StringUtil.isEmpty(pwEnc)) {
          String pwDec = new BlowfishEasy("tpwisgh").decryptString(pwEnc);
          hpw=hash(pwDec);
        }
      }
     
      if(!StringUtil.isEmpty(hpw))
View Full Code Here

TOP

Related Classes of railo.runtime.crypt.BlowfishEasy

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.