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-7/

Secure Key Exchange Service

Build a secure key exchange service that establishes shared secrets between two parties using standardized cryptographic parameters.

Requirements

Your service should provide functionality to:

  1. Initialize key exchange instances using standardized cryptographic parameters rather than generating custom parameters
  2. Generate key pairs for each party in the exchange
  3. Compute shared secrets by exchanging public keys between parties
  4. Support multiple security levels by allowing selection of different standardized parameter sets
  5. Export public keys in hexadecimal format for transmission between parties

Test Cases

  • It successfully establishes matching shared secrets between two parties using the 'modp5' parameter set @test
  • It successfully establishes matching shared secrets using the 'modp14' parameter set @test
  • It returns hexadecimal-encoded public keys @test
  • It produces identical shared secrets when computed by both parties @test

Implementation

@generates

API

/**
 * Creates a key exchange instance using a standardized parameter set.
 *
 * @param {string} groupName - The name of the standardized parameter group to use
 * @returns {object} A key exchange instance
 */
function createKeyExchange(groupName) {
  // IMPLEMENTATION HERE
}

/**
 * Generates a key pair for the exchange instance.
 *
 * @param {object} exchange - The key exchange instance
 */
function generateKeys(exchange) {
  // IMPLEMENTATION HERE
}

/**
 * Gets the public key from an exchange instance.
 *
 * @param {object} exchange - The key exchange instance
 * @returns {string} The public key encoded as hexadecimal
 */
function getPublicKey(exchange) {
  // IMPLEMENTATION HERE
}

/**
 * Computes the shared secret using the other party's public key.
 *
 * @param {object} exchange - The key exchange instance
 * @param {string} otherPublicKey - The other party's public key (hexadecimal)
 * @returns {string} The computed shared secret encoded as hexadecimal
 */
function computeSharedSecret(exchange, otherPublicKey) {
  // IMPLEMENTATION HERE
}

module.exports = {
  createKeyExchange,
  generateKeys,
  getPublicKey,
  computeSharedSecret
};

Dependencies { .dependencies }

crypto-browserify { .dependency }

Provides cryptographic operations for secure key exchange.

Version

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