Skip to content

Commit

Permalink
[nop] Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
ptaoussanis committed Mar 6, 2024
1 parent e7c3888 commit c69992b
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 9 deletions.
58 changes: 49 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,64 @@ See [here][GitHub releases] for earlier releases.
## Why Tempel?

- **Easy-to-use, high-level API** focused on [common tasks](../../wiki/2-Examples) like logins, encryption, signing, etc.
- **Reasonable defaults** including choice of algorithms and work factors
- **Future-proof data formats** with auto-updated algorithms and work factors over time
- Support for [⧉ symmetric](https://en.wikipedia.org/wiki/Symmetric-key_algorithm), [⧉ asymmetric](https://en.wikipedia.org/wiki/Public-key_cryptography) (public-key), and [⧉ end-to-end](https://en.wikipedia.org/wiki/End-to-end_encryption) (E2EE) encryption
- Automatic [⧉ scrypt](https://en.wikipedia.org/wiki/Scrypt) and [⧉ pbkdf2](https://en.wikipedia.org/wiki/PBKDF2) support for easy **password-based key stretching**
- **Reasonable defaults** including choice of algorithms and work factors.
- **Future-proof data formats** with auto-updated algorithms and work factors over time.
- Support for [⧉ symmetric](https://en.wikipedia.org/wiki/Symmetric-key_algorithm), [⧉ asymmetric](https://en.wikipedia.org/wiki/Public-key_cryptography) (public-key), and [⧉ end-to-end](https://en.wikipedia.org/wiki/End-to-end_encryption) (E2EE) encryption.
- Automatic [⧉ scrypt](https://en.wikipedia.org/wiki/Scrypt) and [⧉ pbkdf2](https://en.wikipedia.org/wiki/PBKDF2) support for easy **password-based key stretching**.
- Simple **key management API** for password resets, key rotations, etc.
- Beginner-oriented [documentation](#documentation) and docstrings
- **Comprehensive test suite** with >60k unit tests
- Extensive beginner-oriented [documentation](#documentation) and docstrings.
- **Comprehensive test suite** with >60k unit tests.

Note that Tempel is [not intended](../../wiki/3-Faq#can-i-decrypt-tempel-data-with-other-tools) for interop with other cryptographic tools/APIs.
Note that Tempel is [not intended](../../wiki/3-Faq#can-i-decrypt-tempel-data-with-other-tools) for interop with other cryptographic tools/APIs!

## Video demo

See for intro and usage:
See for intro and usage:

<a href="https://www.youtube.com/watch?v=sULZVFhR848" target="_blank">
<img src="https://img.youtube.com/vi/sULZVFhR848/maxresdefault.jpg" alt="Tempel demo video" width="640" border="0" />
<img src="https://img.youtube.com/vi/sULZVFhR848/maxresdefault.jpg" alt="Tempel demo video" width="480" border="0" />
</a>

## Quick example

```clojure
(require
'[taoensso.tempel :as tempel]
'[taoensso.nippy :as nippy])

;; Create a new private `KeyChain`:
(def my-keychain! (tempel/keychain))
;; => {:n-sym 1, :n-prv 2, :n-pub 2, :secret? true}

;; Use our `KeyChain` to encrypt some data:
(def my-encrypted-data
(tempel/encrypt-with-symmetric-key
(nippy/freeze "My secret data")
my-keychain!)) ; => Encrypted bytes

;; Get back the original unencrypted data:
(nippy/thaw
(tempel/decrypt-with-symmetric-key
my-encrypted-data my-keychain!)) ; => "My secret data"

;; It's safe to store encrypted `KeyChain`s:
(def my-encrypted-keychain
(tempel/encrypt-keychain my-keychain!
{:password "My password"})) ; => Encrypted bytes

;; Get back the original unencrypted `KeyChain`:
(= my-keychain!
(tempel/decrypt-keychain my-encrypted-keychain
{:password "My password"})) ; => true

;; `KeyChain`s also support:
;; - `encrypt-with-1-keypair`
;; - `encrypt-with-2-keypairs`
;; - `sign`

;; See docstrings and/or wiki for more info!
```

## Documentation

- [Wiki][GitHub wiki] (getting started, usage, etc.)
Expand Down
38 changes: 38 additions & 0 deletions examples.clj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,44 @@

(comment (remove-ns 'examples))

;;;; README quick example

(require
'[taoensso.tempel :as tempel]
'[taoensso.nippy :as nippy])

;; Create a new private `KeyChain`:
(def my-keychain! (tempel/keychain))
;; => {:n-sym 1, :n-prv 2, :n-pub 2, :secret? true}

;; Use our `KeyChain` to encrypt some data:
(def my-encrypted-data
(tempel/encrypt-with-symmetric-key
(nippy/freeze "My secret data")
my-keychain!)) ; => Encrypted bytes

;; Get back the original unencrypted data:
(nippy/thaw
(tempel/decrypt-with-symmetric-key
my-encrypted-data my-keychain!)) ; => "My secret data"

;; It's safe to store encrypted `KeyChain`s:
(def my-encrypted-keychain
(tempel/encrypt-keychain my-keychain!
{:password "My password"})) ; => Encrypted bytes

;; Get back the original unencrypted `KeyChain`:
(= my-keychain!
(tempel/decrypt-keychain my-encrypted-keychain
{:password "My password"})) ; => true

;; `KeyChain`s also support:
;; - `encrypt-with-1-keypair`
;; - `encrypt-with-2-keypairs`
;; - `sign`

;; See docstrings and/or wiki for more info!

;;;; Basic `KeyChain` usage

;; Let's create a new `KeyChain` object for our user Alice.
Expand Down

0 comments on commit c69992b

Please sign in to comment.