Security News
The Dark Side of Open Source
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
key-fingerprint
Advanced tools
Readme
Node.js library to easy calculate MD*, SHA*, etc fingerprint of a public/private key.
npm install key-fingerprint
OR
yarn add key-fingerprint
fingerprint(key: string, algorithm: string = 'sha512', colons: boolean = false)
OR
export enum SUPPORTED_ALGORITHM {
MD4 = 'md4',
MD5 = 'md5',
RMD160 = 'rmd160',
SHA1 = 'sha1',
SHA224 = 'sha224',
SHA256 = 'sha256',
SHA384 = 'sha384',
SHA512 = 'sha512',
}
export enum SUPPORTED_ENCODING {
HEX = 'hex',
LATIN1 = 'latin1',
BASE64 = 'base64',
}
interface IConfig {
algorithm: SUPPORTED_ALGORITHM,
colons: boolean,
encoding: SUPPORTED_ENCODING,
}
const DEFAULT_CONFIGURATION: IConfig = {
algorithm: SUPPORTED_ALGORITHM.SHA256,
colons: false,
encoding: SUPPORTED_ENCODING.HEX,
}
fingerprint(key: string, configuration: Partial<IConfig>)
import { fingerprint } from 'key-fingerprint'
const key = '-----BEGIN PUBLIC KEY-----\n.........'
const sha256 = fingerprint(key, 'sha256') // => 'ab12ef12....
const sha256WithColons = fingerprint(key, 'sha256', true) // => 'ab:12:ef:12....
import { fingerprint } from 'key-fingerprint'
const key = '-----BEGIN PUBLIC KEY-----\n.........'
const config = { encoding: 'base64', algorithm: 'sha512' } // options fallback to default if missing
const sha256 = fingerprint(key, config) // => 'ab12ef12....
const sha256WithColons = fingerprint(key, 'sha256', true) // => 'ab:12:ef:12....
FAQs
Node.js library to easy calculate MD*, SHA*, etc fingerprint of a public/private key.
The npm package key-fingerprint receives a total of 1,064 weekly downloads. As such, key-fingerprint popularity was classified as popular.
We found that key-fingerprint demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
Research
Security News
The Socket Research team found this npm package includes code for collecting sensitive developer information, including your operating system username, Git username, and Git email.
Security News
OpenJS is warning of social engineering takeovers targeting open source projects after receiving a credible attempt on the foundation.