Skip to content

Commit 15a87f1

Browse files
committed
update README
1 parent 17935b3 commit 15a87f1

1 file changed

Lines changed: 60 additions & 35 deletions

File tree

README.md

Lines changed: 60 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,76 @@
1-
# **CryptoKit**
1+
CryptoKit
22

3-
![Purpose](https://img.shields.io/badge/purpose-cryptographic%20library-blue)
4-
![Docs](https://img.shields.io/badge/docs-up--to--date-brightgreen)
5-
![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/1/badge)
6-
[![Known Vulnerabilities](https://snyk.io/test/github/RomanTsisyk/CryptoKit/badge.svg)](https://snyk.io/test/github/RomanTsisyk/CryptoKit)
3+
Production-grade Android cryptography library built on Android Keystore. Focus on safe defaults, explicit error modeling, and clear security boundaries.
74

8-
![Status](https://img.shields.io/badge/status-active-brightgreen)
9-
![Last Commit](https://img.shields.io/github/last-commit/RomanTsisyk/CryptoKit)
10-
![GitHub stars](https://img.shields.io/github/stars/RomanTsisyk/CryptoKit?style=social)
11-
![Contributors](https://img.shields.io/github/contributors/RomanTsisyk/CryptoKit)
5+
## Problem
126

7+
Android Keystore APIs are low-level and error-prone. CryptoKit solves specific problems:
138

14-
**CryptoKit** is a comprehensive Kotlin cryptography library designed to secure modern applications. It simplifies encryption, decryption, secure key management, QR code handling, and more, making cryptography accessible for developers.
9+
- Keystore integration requires understanding multiple APIs with fragmented error handling
10+
- Key lifecycle (generation, storage, invalidation) edge cases are often overlooked
11+
- Authentication state changes and device credential updates can silently break encryption flows
12+
- Developers must write boilerplate code to enforce cryptographic best practices
1513

16-
---
14+
CryptoKit provides constrained abstractions that remove these footguns without hiding necessary control.
1715

18-
## **Features**
19-
- AES and RSA Encryption/Decryption
20-
- Secure Key Management and Rotation
21-
- Digital Signatures for Data Authenticity
22-
- QR Code Generation and Decoding
23-
- Robust Error Handling Framework
16+
## Design Goals
2417

25-
---
18+
- Explicit security boundaries and failure modes
19+
- Safe cryptographic defaults (AES-256-GCM, RSA-OAEP, SHA-256)
20+
- Minimal, stable public API
21+
- No exposure of low-level crypto primitives or raw key material
22+
- Sealed exception hierarchy for exhaustive error handling
23+
- Synchronous operations with explicit threading requirements
2624

27-
## CryptoLib Documentation
25+
## Core Capabilities
2826

29-
CryptoLib provides a comprehensive set of cryptographic operations, and with this release, we have also generated full API documentation to help developers integrate it into their projects seamlessly.
27+
- Symmetric encryption (AES-256-GCM) and decryption with authenticated encryption
28+
- Asymmetric key operations (RSA-OAEP) and digital signatures (RSA-SHA256)
29+
- Secure key generation, storage, and lifecycle management via Android Keystore
30+
- Biometric and device credential authentication integration
31+
- Key rotation with configurable validity windows
32+
- QR-based key distribution (generation and parsing)
33+
- Sealed error model with typed exceptions for predictable handling
3034

31-
The documentation covers the following:
35+
## Architecture
3236

33-
- **Key Management**: Generate, retrieve, and delete keys securely from the Keystore.
34-
- **Cryptographic Operations**: Encrypt, decrypt, and sign data with ease.
35-
- **Error Handling**: Detailed error messages and exception handling tailored to cryptographic operations.
36-
- **Usage Examples**: Simple, easy-to-follow examples to get started quickly.
37+
CryptoKit separates public API from Android Keystore implementation details:
3738

38-
You can access the full documentation [here](docs), which includes:
39+
- All key material remains in Android Keystore; plaintext keys are never exposed
40+
- Cryptographic operations are performed by hidden, hardened crypto implementations
41+
- Public methods return sealed exceptions only; no raw Java exceptions leak
42+
- Configuration is explicit: every security-relevant parameter is named and typed
3943

40-
- Function and method signatures
41-
- Descriptions of parameters and return values
42-
- Exception handling details
43-
- Code examples for various use cases
44+
## Threading Model
4445

45-
## 🚀 Get Started
46+
CryptoKit does not manage threading. All cryptographic operations are synchronous and blocking. The caller is responsible for executing operations off the main thread. Long-running operations (key generation, biometric authentication, key rotation) will block the calling thread.
4647

47-
1. Clone this repository.
48-
2. Check out the `docs/` folder for local documentation.
49-
3. Refer to the API docs for in-depth technical details on each class and method.
48+
## Error Handling
5049

51-
---
50+
All failures return sealed subtypes of `CryptoLibException`:
51+
- `CryptoOperationException`: encryption, decryption, signing failures
52+
- `KeyNotFoundException`: requested key does not exist
53+
- `KeyGenerationException`: key creation failed
54+
- `AuthenticationException`: biometric or device credential flow failed
55+
56+
No raw Java exceptions escape the public API. Callers must handle the sealed exception type and pattern-match on subtypes.
57+
58+
## Security Boundaries
59+
60+
CryptoKit is intentionally scoped. It is NOT:
61+
62+
- A TLS or network security library
63+
- A protocol implementation (no OAuth, JWT, etc.)
64+
- A key backup or synchronization solution
65+
- A general-purpose cryptography framework
66+
67+
Key material is managed by Android Keystore only. Encrypted data and keys must be managed by the caller. No automatic secure deletion of plaintext intermediates is guaranteed outside Keystore boundaries.
68+
69+
## Status & Documentation
70+
71+
This library is pre-1.0. API stability is not guaranteed until 1.0 release.
72+
73+
For security policies, threat model, and best practices, see [SECURITY.md](SECURITY.md).
74+
For threading guarantees and blocking behavior, see [CONTRIBUTING.md](CONTRIBUTING.md).
75+
76+
Core API documentation is available in generated Kotlin docs.

0 commit comments

Comments
 (0)