|
1 | 1 | # Okuchi |
2 | 2 |
|
3 | | -> **Ok**amoto-**Uchi**yama |
| 3 | +A pure Rust implementation of the **Okamoto–Uchiyama** cryptosystem - a probabilistic public-key scheme whose security relies on the hardness of factoring and discrete logarithms modulo a composite number. |
4 | 4 |
|
5 | | -A pure Rust implementation of the **Okamoto**-**Uchiyama** Cryptosystem - a probabilistic public-key cryptosystem based on the difficulty of factoring and computing discrete logarithms modulo a composite number. |
| 5 | +**Okuchi** is a portmanteau of **Ok**amoto and **Uchi**yama. |
6 | 6 |
|
7 | | -# References |
| 7 | +## ⚠️ Important Notice |
8 | 8 |
|
9 | | -- Okamoto, T., Uchiyama, S. (1998). "A New Public-Key Cryptosystem as Secure as Factoring" |
| 9 | +The project is evolving and should be treated as a **work in progress**. |
| 10 | +Breaking changes, redesigns, or API removals may occur without notice. |
| 11 | + |
| 12 | +This implementation is (still) **experimental**, **incomplete**, and **not audited** by any external security professionals. |
| 13 | +It may contain defects, conceptual mistakes, side-channel vulnerabilities, insecure parameter choices, or other issues that could compromise confidentiality, integrity, or availability of data. |
| 14 | + |
| 15 | +**Do not use Okuchi in production systems, high-risk environments, or anywhere security or correctness is critical.** |
| 16 | + |
| 17 | +If you choose to use this code despite these warnings, **you do so entirely at your own risk**. No guarantees - explicit or implied - are made regarding performance, correctness, security, or fitness for any purpose. |
| 18 | +The author(s) **assume no liability** for any damages, losses, or consequences resulting from the use, misuse, or inability to use this software. |
| 19 | + |
| 20 | +## Goals |
| 21 | + |
| 22 | +- Provide a correct, readable and safe Rust implementation of the **OU** cryptosystem |
| 23 | +- Serve as a reference for learning and experimentation |
| 24 | +- Maintain minimal dependencies and clear internal structure |
| 25 | + |
| 26 | +This project **does not** aim to be a hardened or production-quality cryptographic library. |
| 27 | + |
| 28 | +## Usage |
| 29 | + |
| 30 | +As mentioned above, until the library matures and receives proper review, usage should be limited to: |
| 31 | + |
| 32 | +- academic experiments |
| 33 | +- prototyping |
| 34 | +- security research |
| 35 | +- code reading and learning |
| 36 | + |
| 37 | +**Production use is strongly discouraged.** |
| 38 | + |
| 39 | +### Example |
| 40 | + |
| 41 | +```rs |
| 42 | +use okuchi::{KeyPair, Okuchi}; |
| 43 | + |
| 44 | +let keypair = KeyPair::new(2048).expect("key generation failed"); |
| 45 | +let pub_key = keypair.pub_key(); |
| 46 | +let priv_key = keypair.priv_key(); |
| 47 | + |
| 48 | +let message = "hello world 🌍"; |
| 49 | + |
| 50 | +// Encrypt (stream API) |
| 51 | +let packed = Okuchi::encrypt_stream(pub_key, message).unwrap(); |
| 52 | + |
| 53 | +// Decrypt |
| 54 | +let decrypted_bytes = Okuchi::decrypt_stream(priv_key, &packed).unwrap(); |
| 55 | +let decrypted = String::from_utf8(decrypted_bytes).unwrap(); |
| 56 | + |
| 57 | +assert_eq!(message, decrypted); |
| 58 | +``` |
| 59 | + |
| 60 | +## References |
| 61 | + |
| 62 | +- Okamoto, T., Uchiyama, S. (1998). _A New Public-Key Cryptosystem as Secure as Factoring._ |
0 commit comments