lib/security.js
function decryptObject(obj, decryptFunction) {
    if (_.isArray(obj)) {
        for (var i = 0; i < obj.length; i++) {
            if (_.isString(obj[i])) {
                if (isEncrypted(obj[i])) {
                    obj[i] = decryptFunction(obj[i]);
                }
            } else {
                decryptObject(obj[i], decryptFunction);
            }
        }
    } else if (_.isObject(obj)) {
        for (var key in obj) {
            if (_.isString(obj[key])) {
                if (isEncrypted(obj[key])) {
                    obj[key] = decryptFunction(obj[key]);
                }
            } else {
                decryptObject(obj[key], decryptFunction);
            }
        }
    }
}
function decryptObject(obj, decryptFunction) {
    if (_.isArray(obj)) {
        for (var i = 0; i < obj.length; i++) {
            if (_.isString(obj[i])) {
                if (isEncrypted(obj[i])) {
                    obj[i] = decryptFunction(obj[i]);
                }
            } else {
                decryptObject(obj[i], decryptFunction);
            }
        }
    } else if (_.isObject(obj)) {
        for (var key in obj) {
            if (_.isString(obj[key])) {
                if (isEncrypted(obj[key])) {
                    obj[key] = decryptFunction(obj[key]);
                }
            } else {
                decryptObject(obj[key], decryptFunction);
            }
        }
    }
}
function decryptObject ( obj , decryptFunction ) { if ( _ . isArray ( obj ) ) { for ( var i = 0 ; i < obj . length ; i ++ ) { if ( _ . isString ( obj [ i ] ) ) { if ( isEncrypted ( obj [ i ] ) ) { obj [ i ] = decryptFunction ( obj [ i ] ) ; } } else { decryptObject ( obj [ i ] , decryptFunction ) ; } } } else if ( _ . isObject ( obj ) ) { for ( var key in obj ) { if ( _ . isString ( obj [ key ] ) ) { if ( isEncrypted ( obj [ key ] ) ) { obj [ key ] = decryptFunction ( obj [ key ] ) ; } } else { decryptObject ( obj [ key ] , decryptFunction ) ; } } } }
Recurse through an object looking for encrypted strings.  If found, replace the string with the decrypted text.
@param obj
@param decryptFunction
Recurse through an object looking for encrypted strings . If found replace the string with the decrypted text .