@sentinel-one/decrypt-ssh-private
    TypeScript icon, indicating that this package has built-in type declarations

    0.0.10 • Public • Published

    decrypt-ssh-private

    npm version License Node.js CI

    A TS library that decrypts ssh keys in the browser.

    Based on the nodejs node-sshpk and uses forge where possible.

    Credit:

    The authors of node-sshpk.

    Special thanks to Ido Kotler (Sentinelone Innovative security researcher) for technical guidance and help in implementation 💣.

    API:

    import { decryptPrivateSSHKey } from '../lib/main';
    import { ErrorClassification, ResultT } from '../lib/error-classifier';
    
    const result: ResultT<ErrorClassification, string> = decryptPrivateSSHKey(encryptedSSHKey, { passphrase: '123456' });
    result
      .ok((output: string) => {
        console.log(output);
        return result;
      })
      .err((err: ErrorClassification) => {
        // do something with the classified error
        console.log(err);
        return result;
      });

    Util functions

    • isValidSSHKey(pem: string): boolean // Checks that a given PEM format is valid or not
    if (isValidSSHKey('invalid key')) {
      // do sothing
    };

    To see it decrypts in the browser just build and serve the example:

    esbuild-browser && npx http-server

    Contributers

    Liron Hazan

    Vova Shabun

    Install

    npm i @sentinel-one/decrypt-ssh-private

    DownloadsWeekly Downloads

    120

    Version

    0.0.10

    License

    BSD

    Unpacked Size

    60.6 kB

    Total Files

    21

    Last publish

    Collaborators

    • janhora
    • npm_service_s1
    • sivanisentinel
    • sentinelone
    • assafa
    • ofir.fridman
    • ozgonen
    • lironhazan
    • irenav
    • yoni12ab
    • koralbenami
    • liorl3009
    • gal.falah
    • amir_barak
    • matans
    • jp-s1
    • vovadev
    • yamarbel
    • shlomim-s1
    • yoavsc
    • frontend-npm-group
    • maayanb