import nodeCrypto from '@elastic/node-crypto' ; export function cryptoFactory ( encryptionKey ? ) { if ( typeof encryptionKey !== 'string' ) { throw new Error ( 'Encryption Key required.' ) ; } return nodeCrypto ( { encryptionKey } ) ; }