How to use the iocane.crypto.encryptWithPassword function in iocane

To help you get started, we’ve selected a few iocane examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github buttercup / buttercup-core / source / node / system / TextDatasource.js View on Github external
.then(function __encryptUsingPassword(encryptedData) {
            return password ? iocane.encryptWithPassword(encryptedData, password) : encryptedData;
        })
        .then(function __encryptUsingKeyFile(encryptedData) {
github buttercup / buttercup-core / source / node / system / credentials.js View on Github external
toSecureString(masterPassword) {
        if (typeof masterPassword !== "string") {
            return Promise.reject(new Error("Master password must be a string"));
        }
        return iocane.encryptWithPassword(this.toInsecureString(), masterPassword).then(signEncryptedContent);
    }
}
github buttercup / buttercup-core / source / classes / Credentials.js View on Github external
convertToSecureContent(masterPassword) {
        if (typeof masterPassword !== "string") {
            throw new Error("Master password must be a string");
        }
        return iocane
            .encryptWithPassword(JSON.stringify(this.model.getData()), masterPassword)
            .then(signEncryptedContent);
    }