GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - msgodf/spritz-clojure: A port of spritzjs to Clojure.

BranchesTags
Open more actions menu

Latest commit

 

History

13 Commits
13 Commits

Folders and files

NameName
Last commit message
Last commit date
src/spritz_clojure
src/spritz_clojure
 
 
test/spritz_clojure
test/spritz_clojure
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
project.clj
project.clj
 
 

Repository files navigation

spritz-clojure

This is a Clojure port of therealjamper's JavaScript implementation of Rivest and Schuldt's Spritz cipher.

The hash, encrypt, decrypt, encrypt-with-iv, and decrypt-with-iv high level functions are implemented.

The functions are written to mimic their presentation in the original paper, as is the case with the JavaScript implementation.

I still have a few things to work out about how best to manage the state of the cipher. At the moment most functions take the state and return a modified version (all of them are pure).

Usage

All of these examples can be run from a Clojure REPL assuming that spritz-clojure has been required into the current namespace with the alias spritz (i.e. with (require '[spritz-clojure.core :as spritz])).

(let [message (map byte "ABC")
      hash-length 32]
    (spritz/hash message hash-length))
(let [key [115 101 116 101 99 45 97 115 116 114 111 110 111 109 121]
      message [84 104 97 110 107 32 121 111 117 32 102 111 114 32 100 101 99 111 100 105 110 103 32 116 104 105 115 32 112 108 97 105 110 116 101 120 116 32 97 116 32 108 101 97 115 116 44 32 73 32 104 111 112 101 32 121 111 117 32 119 105 108 108 32 116 114 121 32 115 112 114 105 116 122 106 115 33]]
    (spritz/encrypt key message))
(let [key [115 101 116 101 99 45 97 115 116 114 111 110 111 109 121]
      message [84 104 97 110 107 32 121 111 117 32 102 111 114 32 100 101 99 111 100 105 110 103 32 116 104 105 115 32 112 108 97 105 110 116 101 120 116 32 97 116 32 108 101 97 115 116 44 32 73 32 104 111 112 101 32 121 111 117 32 119 105 108 108 32 116 114 121 32 115 112 114 105 116 122 106 115 33]]
    (->> message
         (spritz/encrypt key)
         (spritz/decrypt key)))

About

A port of spritzjs to Clojure.

Resources

Readme
MIT license
Activity

Stars

2 stars

Watchers

2 watching

Forks

1 fork
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.