{"id":22043541,"url":"https://github.com/dspearson/azjure","last_synced_at":"2025-03-23T13:47:38.537Z","repository":{"id":170993741,"uuid":"208816762","full_name":"dspearson/azjure","owner":"dspearson","description":"Encryption in Clojure","archived":false,"fork":false,"pushed_at":"2014-08-19T22:16:37.000Z","size":5443,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-28T19:49:20.846Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dspearson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-16T14:11:54.000Z","updated_at":"2020-09-04T18:03:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"48e5b7cb-3957-4a98-8ea5-87edd89a6b36","html_url":"https://github.com/dspearson/azjure","commit_stats":null,"previous_names":["dspearson/azjure"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dspearson%2Fazjure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dspearson%2Fazjure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dspearson%2Fazjure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dspearson%2Fazjure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dspearson","download_url":"https://codeload.github.com/dspearson/azjure/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245111928,"owners_count":20562511,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-30T12:16:30.975Z","updated_at":"2025-03-23T13:47:38.524Z","avatar_url":"https://github.com/dspearson.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"[fips197]: http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf\n[blowfish]: https://www.schneier.com/paper-blowfish-fse.html\n[cast256]: http://tools.ietf.org/html/rfc2612\n[twofish]: http://www.schneier.com/paper-twofish-paper.pdf\n[tea]: http://citeseer.ist.psu.edu/viewdoc/download?doi=10.1.1.45.281\u0026rep=rep1\u0026type=pdf\n[xtea]: http://www.cix.co.uk/~klockstone/xtea.pdf\n[cast128]: http://tools.ietf.org/html/rfc2144\n[salsa20]: http://cr.yp.to/snuffle/spec.pdf\n[chacha]: http://cr.yp.to/chacha/chacha-20080128.pdf\n[hc128]: http://www.ecrypt.eu.org/stream/p3ciphers/hc/hc128_p3.pdf\n[hc256]: http://www3.ntu.edu.sg/home/wuhj/research/hc/hc256_fse.pdf\n[mickey2]: http://www.ecrypt.eu.org/stream/p3ciphers/mickey/mickey_p3.pdf\n[rabbit]: http://tools.ietf.org/rfc/rfc4503.txt\n[trivium]: http://www.ecrypt.eu.org/stream/p3ciphers/trivium/trivium_p3.pdf\n[clojars]: http://clojars.org/azjure\n[travis]: https://travis-ci.org/CraZySacX/azjure\n[cipher]: /src/azjure/cipher/cipher.clj\n[encoders]: /src/azjure/encoders.clj\n[modes]: /src/azjure/modes.clj\n[padders]: /src/azjure/padders.clj\n[mode]: http://en.wikipedia.org/wiki/Block_cipher_mode_of_operation\n[padding]: http://en.wikipedia.org/wiki/Padding_%28cryptography%29\nazjure\n======\n\nEncryption in Clojure\n\n## Version\n[![Clojars Project](http://clojars.org/azjure/latest-version.svg)](clojars)\n\n## Status\n[![Build Status](https://travis-ci.org/CraZySacX/azjure.svg?branch=master)](travis)\n\n## Project Setup\nAdd the following in the dependencies section of your project.clj file\n\n```Clojure\n:dependencies [...\n               [azjure \"1.0.0-SNAPSHOT\"]\n               ...]\n```\n### Configuration Map\nEach function in the API uses map to configure the behavior of the\nencrypt/decrypt functions.\n\nThe map has the following format:\n\n```clojure\n{:type :typekw\n :mode :modekw\n :pad  :padderkw\n :eid  :input-decoderkw\n :eoe  :output-encoderkw\n :did  :input-decoderkw\n :doe  :output-encoderkw\n :key  []\n :iv   []}\n```\n\n* **type** - A keyword that identifies the cipher you wish to use. See\n[cipher.clj][cipher] for supported values.\n* **mode** - A keyword that identifies the block chaining mode you wish to use.\nSee [modes.clj][modes] for supported values.\n* **pad** - A keyword that identifies the padder you wish to use. See\n[padders.clj][padders] for supported values.\n* **eid** - A keyword that represents the encryption input decoder you wish to\nuse. See [encoders.clj][encoders] for supported values.\n* **eoe** - A keyword that represents the encryption output encoder you wish to\nuse. See [encoders.clj][encoders] for supported values.\n* **did** - A keyword that represents the decryption input decoder you wish to\nuse. See [encoders.clj][encoders] for supported values.\n* **doe** - A keyword that represents the decryption output encoder you wish to\nuse. See [encoders.clj][encoders] for supported values.\n* **key** - A vector of unsigned bytes (0-255) of the appropriate length that\nrepresents the key you wish to use with the cipher.\n* **iv** - A vector of unsigned bytes (0-255) of the appropriate length that\nrepresents the IV you wish to use with the block chaining mode.\n* **nonce** - A vector of unsigned bytes (0-255) of the appropriate length that\nrepresents the nonce you with to use with the stream cipher.\n\n### Block Cipher Usage (Quick)\n```Clojure\n(:require ...\n          [azjure.core :refer :all]\n          [azjure.cipher.aes :refer :all] \n          ;Require all the cipher(s) you wish to use\n          ...\n          )\n```\nEncrypt\n\n```Clojure\n;; Encrypt a vector of unsigned bytes\n;; Note that the keys shown below are the required keys for a \n;; block cipher\n(encrypt [0 0 0 0]\n         {:type :aes :mode :ecb :pad :pkcs7\n          :key [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n          :iv [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]})\n;; Should evaluate to\n;; [223 80 151 26 46 117 190 64 134 255 95 229 221 229 165 35]\n```\n\nDecrypt\n\n```Clojure\n;; Decrypt a vector of unsigned bytes\n(decrypt [223 80 151 26 46 117 190 64 134 255 95 229 221 229 165 35]\n         {:type :aes :mode :ecb :pad :pkcs7\n          :key [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n          :iv [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]})\n;; Should evaluate to [0 0 0 0]\n```\n\n### Stream Cipher Usage (Quick)\n\n```Clojure\n(:require ...\n          [azjure.core :refer :all]\n          [azjure.cipher.salsa20 :refer :all]\n          ;Require all the ciphers(s) you wish to use\n          ...\n          )\n```\n\nEncrypt/Decrypt\n\n```Clojure\n;; Generate ciphertext\n;; Note that the keys shown below are the required keys for\n;; a stream cipher\n(encrypted-stream [0 0 0 0]\n                  {:type :salsa20\n                   :key [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n                   :nonce [0 0 0 0 0 0 0 0]})\n;; Should evaluate to [101 19 173 174]\n\n;; Generate plaintext\n(encrypted-stream [101 19 173 174]\n                  {:type :salsa20\n                   :key [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n                   :nonce [0 0 0 0 0 0 0 0]})\n;; Should evaluate to [0 0 0 0]\n```\n\n## More Examples\nSee the [examples](/docs/EXAMPLES.md) documentation for more\nextensive usage examples\n\n## Supported Ciphers\n### Block\n1. Advanced Encryption Standard (AES) - [FIPS 197][fips197]\n2. Blowfish (BF) - [Blowfish Spec][blowfish]\n3. CAST-256 (CAST6) - [CAST-256 RFC][cast256]\n4. Twofish (TF) - [Twofish Spec][twofish]\n5. TEA (TEA) - [TEA Spec][tea]\n6. XTEA (XTEA) - [XTEA Spec][xtea]\n\n### Block - In Progress\n1. CAST-128 (CAST5) - [CAST-128 RFC][cast128]\n\n### Stream\n1. Salsa20 (Salsa20) - [Salsa20 Spec][salsa20]\n2. ChaCha (Chacha) - [ChaCha Spec][chacha]\n\n### Stream - In Progress\n1. HC-128 (HC128) - [HC-128 Spec][hc128]\n2. HC-256 (HC256) - [HC-256 Spec][hc256]\n3. MICKEY2.0 (MICKEY2.0) - [MICKEY2.0 Spec][mickey2]\n4. Rabbit (Rabbit) - [Rabbit Spec][rabbit]\n5. Trivium (Trivium) - [Trivium Spec][trivium]\n\n## Supported Modes\nCipher modes describe the method for encrypting multiple blocks with block ciphers.\n\nSee [Mode of Operation][mode] for\ndescriptions\n\n### Block Only Modes\n1. Electronic Codebook (ECB)\n2. Cipher-Block Chaining (CBC)\n3. Propagating Cipher-Block Chaining (PCBC)\n\n### Modes able to use Block Ciphers as Stream Ciphers\n1. Cipher Feedback (CFB)\n2. Output Feedback (OFB)\n3. Counter (CTR)\n\n## Supported Padding\nSome cipher modes (ECB, CBC, PCBC) require that the input be padded with bytes\nuntil a multiple of the cipher's blocksize.  The following padding methods are\nsupported.\n\nSee [Padding][padding] for\ndescriptions\n\n1. PKCS7\n2. Zero Byte\n3. ISO 10126\n4. ANSI X.923\n5. ISO/IEC 7816-4\n\n## Character Encoding/Decoding\nBy default the API works with vectors of unsigned bytes.  However, there is\nbuilt in support for converting to and from many common character encodings.\n\nThe following encodings are supported:\n\n1. str       - ASCII character encoding\n2. hex       - hex encoding (0-9a-f)\n3. base16    - Base16 encoding (0-9A-F)\n4. base32    - Base32 encoding (A-Z2-7)\n5. base32hex - Base32 encoding with a hex alphabet (0-9A-V)\n6. base64    - Base64 encoding (A-Za-z0-9+/)\n7. base64url - Base64 encoding with the URL safe alphabet (A-Za-z0-9-_)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdspearson%2Fazjure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdspearson%2Fazjure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdspearson%2Fazjure/lists"}