Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xsc/clj-kasumi
Implementation of KASUMI cipher in pure Clojure.
https://github.com/xsc/clj-kasumi
Last synced: 27 days ago
JSON representation
Implementation of KASUMI cipher in pure Clojure.
- Host: GitHub
- URL: https://github.com/xsc/clj-kasumi
- Owner: xsc
- Created: 2012-12-14T23:43:39.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2012-12-28T19:13:39.000Z (almost 12 years ago)
- Last Synced: 2024-04-13T20:15:38.831Z (7 months ago)
- Language: Clojure
- Size: 113 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# clj-kasumi
This is an implementation of the [KASUMI](http://en.wikipedia.org/wiki/KASUMI) block cipher in pure Clojure. It - this implementation, that is - does neither perform well nor make any guarantees regarding security.
__Do not use in production code, only for educational purposes!__
## Usage
Include in Leiningen:
```clojure
[clj-kasumi "0.1.0"]
```KASUMI operates on 64-bit words which are represented as a a vector of two 32-bit integers. A single word can be encrypted/decrypted using `clj-kasumi.core/encode-word64` and `clj-kasumi.core/decode-word64` respectively:
```clojure
(ns test
(:use [clj-kasumi.core :as kasumi]));; a key is an eight-element vector of 16-bit integers
(def K [ 0 1 2 3 4 5 6 7 ]);; encode/decode word
(kasumi/encode-word64 K [30 32]) ;; -> [3255589620 1286811847]
(kasumi/decode-word64 K [3255589620 1286811847]) ;; -> [30 32]
```The functions `clj-kasumi.core/encode-string` and `clj-kasumi.core/decode-string` can be used to encrypt/decrypt complete strings. And finally, the function `clj-kasumi.core/string->key` creates an eight-element key vector from any given string by converting pairs of characters into 16-bit integers.
## Thanks
Thanks to Dominik Vinan for introducing me to the challenge of implementing this and supplying small and useful parts
to begin with (even though he decided to do it in Haskell).## License
Copyright © 2012 Yannick Scherer
Distributed under the Eclipse Public License, the same as Clojure.