How to use the rfc4648.base64url function in rfc4648

To help you get started, we’ve selected a few rfc4648 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 paragonie / ciphersweet-js / lib / backend / fipsrypto.js View on Github external
"use strict";

const base32 = require('rfc4648').base32;
const base64url = require('rfc4648').base64url;
const Backend =  require('../contract/backend');
const Constants = require('../constants');
const crypto = require('crypto');
const fs = require('fs-extra');
const SodiumPlus = require('sodium-plus').SodiumPlus;
const Util = require('../util');
const SymmetricKey = require('./key/symmetrickey');
const CryptoOperationException = require('../exception/cryptooperationexception');

let sodium;
const MAGIC_HEADER = "fips:";
const MAC_SIZE = 48;
const SALT_SIZE = 32;
const NONCE_SIZE = 16;

/**
github paragonie / ciphersweet-js / lib / transformation / compound.js View on Github external
"use strict";

const base64url = require('rfc4648').base64url;
const RowTransformation = require('../contract/rowtransformation');
const Util = require('../util');

module.exports = class Compound extends RowTransformation
{
    /**
     * @param {Array} input
     * @return {string}
     */
    async invoke(input)
    {
        let result = JSON.stringify(
            await Compound.processArray(input, 0)
        );
        if (result === '{}') {
            return '[]';
github paragonie / ciphersweet-js / lib / backend / moderncrypto.js View on Github external
"use strict";

const base32 = require('rfc4648').base32;
const base64url = require('rfc4648').base64url;
const ChaCha20 = require('xchacha20-js').ChaCha20;
const Constants = require('../constants');
const fs = require('fs-extra');
const Backend =  require('../contract/backend');
const HChaCha20 = require('xchacha20-js').HChaCha20;
const Poly1305 = require('poly1305-js');
const {SodiumPlus, CryptographyKey} = require('sodium-plus');
const Util = require('../util');
const SymmetricKey = require('./key/symmetrickey');
const CryptoOperationException = require('../exception/cryptooperationexception');

let sodium;
const MAGIC_HEADER = "nacl:";
const NONCE_SIZE = 24;
const TAG_SIZE = 16;