
Product
Reachability for Ruby Now in Beta
Reachability analysis for Ruby is now in beta, helping teams identify which vulnerabilities are truly exploitable in their applications.
@thirdweb-dev/crypto
Advanced tools
Secure, performant and cross-platform cryptography methods commonly used across other thirdweb packages.
npm install @thirdweb-dev/crypto
| method | use case | return type | underlying technology |
|---|---|---|---|
aesEncrypt(<plaintext>, <password>) | Encrypts a string/Uint8Array with AES-GCM | Promise<string> | WebCrypto (AES-GCM) |
aesDecrypt(<ciphertext>, <password>) | Decrypts a value encrypted via aesEncrypt | Promise<string> | WebCrypto (AES-GCM) |
aesDecryptCompat(<ciphertext>, <password>) | Same as aesDecrypt but also supports values encrypted via crypto-js (for backwards compatibility) | Promise<string> | WebCrypto (AES-GCM) |
| method | use case | return type | underlying technology |
|---|---|---|---|
sha256(<value>) | Hashes a string/Uint8Array with SHA256 | Promise<Uint8Array> | WebCrypto |
sha256Hex(<value>) | Same as sha256 but reruns as hex string | Promise<string> | WebCrypto |
sha256Sync(<value>) | Same as sha256 but synchronous | Uint8Array | @noble/hashes |
sha256SyncHex(<value>) | Same as sha256Sync but reruns as hex string | string | @noble/hashes |
keccak256Sync(<value>) | Hashes a string/Uint8Array with Keccak256 | Uint8Array | js-sha3 |
keccak256SyncHex(<value>) | Same as keccak256Sync but returns as hex string | string | js-sha3 |
keccak256SyncHexPrefixed(<value>) | Same as keccak256Sync but returns as 0x prefixed hex string | 0x${string} | js-sha3 |
ββββββββββββββββββββββββββββββββ¬ββββββββββ¬βββββββββββββββββββββ¬βββββββββ¬ββββββββββ
β Task Name β ops/sec β Average Time (ns) β Margin β Samples β
ββββββββββββββββββββββββββββββββΌββββββββββΌβββββββββββββββββββββΌβββββββββΌββββββββββ€
β @thirdweb-dev/crypto (async) β 112,929 β 8855.08539999982 β Β±1.37% β 100000 β
β @thirdweb-dev/crypto (sync) β 55,004 β 18180.482820000594 β Β±1.02% β 100000 β
β crypto-js (sync) β 19,213 β 52047.35353999857 β Β±0.25% β 100000 β
ββββββββββββββββββββββββββββββββ΄ββββββββββ΄βββββββββββββββββββββ΄βββββββββ΄ββββββββββ
ββββββββββββββββββββββββββββββββ¬ββββββββββ¬βββββββββββββββββββββ¬βββββββββ¬ββββββββββ
β Task Name β ops/sec β Average Time (ns) β Margin β Samples β
ββββββββββββββββββββββββββββββββΌββββββββββΌβββββββββββββββββββββΌβββββββββΌββββββββββ€
β @thirdweb-dev/crypto (async) β 100,845 β 9916.125730001713 β Β±1.24% β 100000 β
β @thirdweb-dev/crypto (sync) β 53,751 β 18604.047449997142 β Β±0.92% β 100000 β
β crypto-js (sync) β 19,077 β 52419.03465000334 β Β±0.24% β 100000 β
ββββββββββββββββββββββββββββββββ΄ββββββββββ΄βββββββββββββββββββββ΄βββββββββ΄ββββββββββ
ββββββββββββββββββββββββ¬ββββββββββ¬βββββββββββββββββββββ¬βββββββββ¬ββββββββββ
β Task Name β ops/sec β Average Time (ns) β Margin β Samples β
ββββββββββββββββββββββββΌββββββββββΌβββββββββββββββββββββΌβββββββββΌββββββββββ€
β @thirdweb-dev/crypto β 72,533 β 13786.719900000808 β Β±0.31% β 100000 β
β ethers@v5 β 71,891 β 13909.94663000107 β Β±0.33% β 100000 β
β @noble/hashes β 27,244 β 36704.73226000136 β Β±0.19% β 100000 β
β viem β 27,115 β 36879.07953999698 β Β±0.26% β 100000 β
ββββββββββββββββββββββββ΄ββββββββββ΄βββββββββββββββββββββ΄βββββββββ΄ββββββββββ
ββββββββββββββββββββββββ¬ββββββββββ¬ββββββββββββββββββββ¬βββββββββ¬ββββββββββ
β Task Name β ops/sec β Average Time (ns) β Margin β Samples β
ββββββββββββββββββββββββΌββββββββββΌββββββββββββββββββββΌβββββββββΌββββββββββ€
β @thirdweb-dev/crypto β 42,947 β 23284.22780000266 β Β±0.23% β 100000 β
β ethers@5 β 35,568 β 28114.98005000045 β Β±0.42% β 100000 β
β @noble/hashes β 15,149 β 66009.80448000187 β Β±0.26% β 100000 β
β viem β 15,217 β 65714.15843999518 β Β±0.25% β 100000 β
ββββββββββββββββββββββββ΄ββββββββββ΄ββββββββββββββββββββ΄βββββββββ΄ββββββββββ
FAQs
thirdweb crypto <a href=
We found that @thirdweb-dev/crypto demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.Β It has 6 open source maintainers 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.

Product
Reachability analysis for Ruby is now in beta, helping teams identify which vulnerabilities are truly exploitable in their applications.

Research
/Security News
Malicious npm packages use Adspect cloaking and fake CAPTCHAs to fingerprint visitors and redirect victims to crypto-themed scam sites.

Security News
Recent coverage mislabels the latest TEA protocol spam as a worm. Hereβs whatβs actually happening.