CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/npm-crypto-browserify

tessl install tessl/npm-crypto-browserify@3.12.0

Browser-compatible implementation of Node.js crypto module providing cryptographic operations in web environments.

Agent Success

Agent success rate when using this tile

100%

Improvement

Agent success rate improvement when using this tile compared to baseline

1x

Baseline

Agent success rate without this tile

100%

task.mdevals/scenario-4/

Document Signature Generator

A utility that generates cryptographic signatures for documents to ensure authenticity and integrity.

Capabilities

Signs documents with RSA keys

  • Given a document string and an RSA private key, it generates a digital signature using the RSA-SHA256 algorithm and returns it as a hex-encoded string @test

Supports streaming data for signing

  • Given multiple document chunks, it can process them incrementally and produce a single signature for the combined content @test

Provides different output formats

  • Given a document and private key, it can return the signature in base64 encoding when requested @test

Implementation

@generates

API

/**
 * Signs a document string using an RSA private key with SHA-256 algorithm.
 *
 * @param {string} document - The document content to sign
 * @param {string|Buffer} privateKey - PEM-encoded RSA private key
 * @param {string} [encoding='hex'] - Output encoding ('hex' or 'base64')
 * @returns {string} The digital signature in the specified encoding
 */
function signDocument(document, privateKey, encoding = 'hex') {
  // IMPLEMENTATION HERE
}

/**
 * Signs multiple document chunks using an RSA private key with SHA-256 algorithm.
 * This is useful for large documents that need to be processed in chunks.
 *
 * @param {string[]} chunks - Array of document chunks to sign
 * @param {string|Buffer} privateKey - PEM-encoded RSA private key
 * @returns {string} The digital signature in hex encoding
 */
function signChunks(chunks, privateKey) {
  // IMPLEMENTATION HERE
}

module.exports = {
  signDocument,
  signChunks,
};

Dependencies { .dependencies }

crypto-browserify { .dependency }

Provides cryptographic signing capabilities.

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
npmpkg:npm/crypto-browserify@3.12.x
tile.json