private static void updateEncryptionProperties(String newAlg, String newKey) {
        // load DB properties using the current key
        if(properties == null) {
            properties = JiveProperties.getInstance();
        }
        //create the new encryptor
        currentKey = newKey.isEmpty() ? null : newKey;
        propertyEncryptorNew = getEncryptor(newAlg, newKey);
        
        // Use new key to update configuration properties
        Iterator<Entry<String, String>> iterator = properties.entrySet().iterator();
        Entry<String, String> entry;
        String name;
        while(iterator.hasNext()){
            entry = iterator.next();
            name = entry.getKey();
            // only need to update the encrypted ones
            if (isPropertyEncrypted(name)) {
                properties.put(name, entry.getValue());
            }
        }
        // Update encryption properties to XML, using new encryption key
        for (String propertyName : securityProperties.getProperties(ENCRYPTED_PROPERTY_NAMES, true)) {
            String xmlProperty = getXMLProperty(propertyName);
            // update xml prop
            if(StringUtils.isNotEmpty(xmlProperty)){
                Log.info("Updating encrypted value for " + propertyName);
                setXMLProperty(propertyName, xmlProperty);
            }
        }
        // Two encryptors are now the same
        propertyEncryptor = propertyEncryptorNew;
    }
Re-encrypted with a new key and new algorithm configuration

@param newAlg new algorithm type
@param newKey new encryptor key
xmppserver/src/main/java/org/jivesoftware/util/JiveGlobals.java