Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mauricioszabo/microscope-crypt
https://github.com/mauricioszabo/microscope-crypt
Last synced: about 4 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/mauricioszabo/microscope-crypt
- Owner: mauricioszabo
- Created: 2018-03-14T23:11:17.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2017-04-19T14:09:04.000Z (over 7 years ago)
- Last Synced: 2024-11-09T05:31:44.857Z (about 2 months ago)
- Language: Clojure
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Microscope Crypt
[![Build Status](https://travis-ci.org/acessocard/microscope-crypt.svg?branch=master)](https://travis-ci.org/acessocard/microscope-crypt)
[![Clojars Project](https://img.shields.io/clojars/v/microscope/crypt.svg)](https://clojars.org/microscope/crypt)
[![Dependencies Status](https://jarkeeper.com/acessocard/microscope-crypt/status.svg)](https://jarkeeper.com/acessocard/microscope-crypt)A simple project to provide simple asymmetric encryption and decryption
## Usage
```clojure
(require '[microscope.core :as c]
'[microscope.future :as future]
'[microscope.crypt :as crypt]
'[environ.core :refer [env]])(let [subscribe (c/subscribe-with :encrypt (crypt/for-encryption (env :public-key))
:decrypt (crypt/for-decryption (env :private-key))
:some-queue (dont-matter-who))]
(subscribe :some-queue (fn [f {:keys [encrypt decrypy]}]
(->> f
(future/map #(encrypt (:payload %)))
(future/intercept println) ; Will print encrypted
(future/map #(decrypt (:payload %)))
(future/intercept println))))) ; Will print decrypted
```