Browser-compatible implementation of Node.js crypto module providing cryptographic operations in web environments.
Overall
score
100%
Build a license verification system that validates software licenses using digital signatures.
Your company issues software licenses to customers. Each license is a JSON document containing license details (customer name, expiration date, allowed features). To prevent tampering, each license is digitally signed by your company's private key. Customer systems need to verify these licenses are authentic before granting access.
Implement a license verification module with two functions:
Create a function verifyLicense(licenseData, signature, publicKey) that:
true if the signature is valid, false otherwiseCreate a function verifyMultipleLicenses(licenses, publicKey) that:
data (string) and signature (hex-encoded string)valid: array of indices of valid licensesinvalid: array of indices of invalid licensesGiven:
"customer:acme-corp,expires:2025-12-31,features:premium"When: Verifying the license
Then: Returns true
Given:
When: Verifying the modified license
Then: Returns false
Given:
When: Verifying all licenses in batch
Then: Returns object with valid: [0, 2] and invalid: [1]
license-verifier.js that exports both functionslicense-verifier.test.js with test casesProvides cryptographic operations for signature verification in browser and Node.js environments.
Install with Tessl CLI
npx tessl i tessl/npm-crypto-browserifydocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10