Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Primary Navigation

    • Cloud & Deployment
    • Core Language & Structure
    • Data Manipulation & Analysis
    • Engineering Data & Computation
    • External Interfaces & Connections
    • Financial Data & Computation
    • Geographic Data & Computation
    • Geometry
    • Graphs & Networks
    • Higher Mathematical Computation
    • Images
    • Knowledge Representation & Natural Language
    • Machine Learning
    • Notebook Documents & Presentation
    • Scientific and Medical Data & Computation
    • Social, Cultural & Linguistic Data
    • Strings & Text
    • Symbolic & Numeric Computation
    • System Operation & Setup
    • Time-Related Computation
    • User Interface Construction
    • Visualization & Graphics
    • Random Paclet
    • Alphabetical List
  • Using Paclets
    • Get Started
    • Download Definition Notebook
  • Learn More about Wolfram Language

Kyber

Symbols

  • KyberDecapsulate
  • KyberEncapsulate
  • KyberKeyGen
ToneAr`Kyber`
KyberDecapsulate
​
KyberDecapsulate
[cipherText,privateKey]
recovers the shared secret from
cipherText
using the recipient’s
privateKey
.
​
Details and Options
​
Examples  
(3)
Basic Examples  
(1)
Generate a key pair, encapsulate a shared secret, then decapsulate it:
In[1]:=
keys=
KyberKeyGen
[768]
Out[1]=
PublicKeyPublicKey
Type: ML-KEM
Parameter set: 768
Public key size:
9472
b
,PrivateKeyPrivateKey
Type: ML-KEM
Parameter set: 768
Private key size:
19200
b

In[2]:=
encap=
KyberEncapsulate
[keys["PublicKey"]]
Out[2]=
EncapsulatedKeyEncapsulatedKey
Type: ML-KEM
Parameter set: 768
Cipher text size:
8704
b
,SharedSecretSymmetricKey
Cipher: AES256
Key size:
256
b

Recover the shared secret using the private key:
In[3]:=
decap=
KyberDecapsulate
[encap["EncapsulatedKey"],keys["PrivateKey"]]
Out[3]=
SymmetricKey
Cipher: AES256
Key size:
256
b

Verify the shared secrets are identical:
In[4]:=
encap["SharedSecret"]===decap
Out[4]=
True
Scope  
(1)

Properties & Relations  
(1)

SeeAlso
KyberKeyGen
 
▪
KyberEncapsulate
 
▪
Decrypt
RelatedLinks
▪
NIST Post-Quantum Cryptography
""

© 2026 Wolfram. All rights reserved.

  • Legal & Privacy Policy
  • Contact Us
  • WolframAlpha.com
  • WolframCloud.com