Socket
Book a DemoInstallSign in
Socket

@sentinel-one/decrypt-ssh-private

Package Overview
Dependencies
Maintainers
22
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sentinel-one/decrypt-ssh-private

Decrypts ssh keys in the browser

0.0.10
latest
Source
npmnpm
Version published
Weekly downloads
167
35.77%
Maintainers
22
Weekly downloads
 
Created
Source

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

Keywords

openssl

FAQs

Package last updated on 19 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.