Current Path: > > lib > node_modules > npm > node_modules > sshpk > > lib
Operation : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64 Software : Apache Server IP : 162.0.232.56 | Your IP: 216.73.216.111 Domains : 1034 Domain(s) Permission : [ 0755 ]
Name | Type | Size | Last Modified | Actions |
---|---|---|---|---|
formats | Directory | - | - | |
algs.js | File | 4866 bytes | March 10 2021 14:36:38. | |
certificate.js | File | 10764 bytes | March 10 2021 14:36:38. | |
dhe.js | File | 10974 bytes | March 10 2021 14:36:38. | |
ed-compat.js | File | 2426 bytes | March 10 2021 14:36:38. | |
errors.js | File | 2770 bytes | March 10 2021 14:36:38. | |
fingerprint.js | File | 3995 bytes | March 10 2021 14:36:38. | |
identity.js | File | 7831 bytes | March 10 2021 14:36:38. | |
index.js | File | 1238 bytes | March 10 2021 14:36:38. | |
key.js | File | 7584 bytes | March 10 2021 14:36:38. | |
private-key.js | File | 6730 bytes | March 10 2021 14:36:38. | |
signature.js | File | 7989 bytes | March 10 2021 14:36:38. | |
ssh-buffer.js | File | 3877 bytes | March 10 2021 14:36:38. | |
utils.js | File | 9600 bytes | March 10 2021 14:36:38. |
// Copyright 2015 Joyent, Inc. module.exports = { Verifier: Verifier, Signer: Signer }; var nacl; var stream = require('stream'); var util = require('util'); var assert = require('assert-plus'); var Buffer = require('safer-buffer').Buffer; var Signature = require('./signature'); function Verifier(key, hashAlgo) { if (nacl === undefined) nacl = require('tweetnacl'); if (hashAlgo.toLowerCase() !== 'sha512') throw (new Error('ED25519 only supports the use of ' + 'SHA-512 hashes')); this.key = key; this.chunks = []; stream.Writable.call(this, {}); } util.inherits(Verifier, stream.Writable); Verifier.prototype._write = function (chunk, enc, cb) { this.chunks.push(chunk); cb(); }; Verifier.prototype.update = function (chunk) { if (typeof (chunk) === 'string') chunk = Buffer.from(chunk, 'binary'); this.chunks.push(chunk); }; Verifier.prototype.verify = function (signature, fmt) { var sig; if (Signature.isSignature(signature, [2, 0])) { if (signature.type !== 'ed25519') return (false); sig = signature.toBuffer('raw'); } else if (typeof (signature) === 'string') { sig = Buffer.from(signature, 'base64'); } else if (Signature.isSignature(signature, [1, 0])) { throw (new Error('signature was created by too old ' + 'a version of sshpk and cannot be verified')); } assert.buffer(sig); return (nacl.sign.detached.verify( new Uint8Array(Buffer.concat(this.chunks)), new Uint8Array(sig), new Uint8Array(this.key.part.A.data))); }; function Signer(key, hashAlgo) { if (nacl === undefined) nacl = require('tweetnacl'); if (hashAlgo.toLowerCase() !== 'sha512') throw (new Error('ED25519 only supports the use of ' + 'SHA-512 hashes')); this.key = key; this.chunks = []; stream.Writable.call(this, {}); } util.inherits(Signer, stream.Writable); Signer.prototype._write = function (chunk, enc, cb) { this.chunks.push(chunk); cb(); }; Signer.prototype.update = function (chunk) { if (typeof (chunk) === 'string') chunk = Buffer.from(chunk, 'binary'); this.chunks.push(chunk); }; Signer.prototype.sign = function () { var sig = nacl.sign.detached( new Uint8Array(Buffer.concat(this.chunks)), new Uint8Array(Buffer.concat([ this.key.part.k.data, this.key.part.A.data]))); var sigBuf = Buffer.from(sig); var sigObj = Signature.parse(sigBuf, 'ed25519', 'raw'); sigObj.hashAlgorithm = 'sha512'; return (sigObj); };
SILENT KILLER Tool