components/ciphertool/src/main/java/org/wso2/ciphertool/CipherTool.java
private static void encryptCipherTextFile(Cipher cipher) {
        Properties properties = new Properties();
        for (Map.Entry<String, String> entry : aliasPasswordMap.entrySet()) {
            String value = entry.getValue();
            if (value != null && !value.equals("")) {
                if (value.contains("[") && value.indexOf("]") > 0) {
                    value = value.substring(value.indexOf("[") + 1, value.indexOf("]"));
                    value = doEncryption(cipher, value);
                }
            } else {
                value = getPasswordFromConsole(entry.getKey(), cipher);
            }
            properties.setProperty(entry.getKey(), value);
        }

        Utils.writeToPropertyFile(properties, System.getProperty(Constants.CIPHER_TEXT_PROPERTY_FILE_PROPERTY));
    }
/**
     * Encrypt plain text password defined in cipher-text.properties file. If not read password from command-line and
     * save to cipher-text.properties
     *
     * @param cipher cipher
     */
Encrypt plain text password defined in cipher-text.properties file. If not read password from command-line and
save to cipher-text.properties

@param cipher cipher
Encrypt plain text password defined in cipher - text . properties file . If not read password from command - line and save to cipher - text . properties @param cipher cipher
private static void encryptCipherTextFile(Cipher cipher) {
        Properties properties = new Properties();
        for (Map.Entry<String, String> entry : aliasPasswordMap.entrySet()) {
            String value = entry.getValue();
            if (value != null && !value.equals("")) {
                if (value.contains("[") && value.indexOf("]") > 0) {
                    value = value.substring(value.indexOf("[") + 1, value.indexOf("]"));
                    value = doEncryption(cipher, value);
                }
            } else {
                value = getPasswordFromConsole(entry.getKey(), cipher);
            }
            properties.setProperty(entry.getKey(), value);
        }
        Utils.writeToPropertyFile(properties, System.getProperty(Constants.CIPHER_TEXT_PROPERTY_FILE_PROPERTY));
    }
private static void encryptCipherTextFile ( Cipher cipher ) { Properties properties = new Properties ( ) ; for ( Map . Entry < String , String > entry : aliasPasswordMap . entrySet ( ) ) { String value = entry . getValue ( ) ; if ( value != null && ! value . equals ( "" ) ) { if ( value . contains ( "[" ) && value . indexOf ( "]" ) > 0 ) { value = value . substring ( value . indexOf ( "[" ) + 1 , value . indexOf ( "]" ) ) ; value = doEncryption ( cipher , value ) ; } } else { value = getPasswordFromConsole ( entry . getKey ( ) , cipher ) ; } properties . setProperty ( entry . getKey ( ) , value ) ; } Utils . writeToPropertyFile ( properties , System . getProperty ( Constants . CIPHER_TEXT_PROPERTY_FILE_PROPERTY ) ) ; }
Encrypt plain text password defined in cipher-text.properties file.
Encrypt plain text password defined in cipher - text . properties file .