Git Product home page Git Product logo

redroom's Introduction

Easy crypto for Redis

RedRoom is powered by the Zenroom crypto VM to bring easy to use yet advanced cryptographic functions in Redis.

This software is in ALPHA stage and published for preview.

The main use-case covered is that of secure password storage using hashes inside username keys and check if password matches.

Future plans and low hanging fruits:

  • authenticated private messaging using encrypted PUB/SUB channels with asymmetric keypairs
  • brute-force resistant hashing with alternatives to SHA512 that cannot run on GPUs

We are open to more ideas: don't hesitate to show us your interest, it motivates us!

Supported platforms

RedRoom is developed and tested on Linux, Windows and Mac OS.

RedRoom runs fine on ARM, i386 and x86_64 CPUs.

The Zenroom crypto engine at the core of RedRoom is portable to:

  • native iOS framework
  • native Android library
  • Javascript and WebAssembly
  • Cortex chips
  • ... even more targets
<script id="asciicast-255267" src="https://asciinema.org/a/255267.js" async></script>

Commands

All commands provided by Redroom are prefixed with ZENROOM. or ZENCODE.

ZENROOM.EXEC

ZENROOM.EXEC SCRIPT DESTINATION [ KEYS DATA ]

Execute the contents stored in key SCRIPT using the Zenroom VM language based on Lua, then stores the result in key DESTINATION; the execution is passed two arguments, the contents of keys KEYS and DATA.

ZENCODE.EXEC

ZENCODE.EXEC ZENCODE DESTINATION [ KEYS DATA ]

Execute the human language instructions stored in the key ZENCODE using the Zenroom VM, then stores the result in key DESTINATION; the execution is passed two arguments, the contents of keys KEYS and DATA. For more information on the human language used see Zencode: Smart contracts for the English speaker.

ZENROOM.SETPASS

ZENROOM.SETPASS USERNAME PASSWORD

Safely stores the string PASSWORD hashed using SHA512 and KDF inside key USERNAME (base64 encoded). Username keys will not contain actual password strings, but hashes that are only useful to verify if the password given at a login is correct, using ZENROOM.CHECKPASS.

The Zenroom code used is: write(ECDH.kdf(HASH.new('sha512'),'%s'):base64())

ZENROOM.CHECKPASS

ZENROOM.CHECKPASS USERNAME PASSWORD

Checks that the key USERNAME is existing and its contents match the PASSWORD string when hashed using SHA512 and KDF.

BENCHMARK

A port of redis-benchmark is provided and builds with target make check.

Performance of ZENROOM.SETPASS can be tested with:

./benchmark -t zenroom.setpwd -n 1000 -r 1000

On a fifth gen i5 (2.4GHz) running Redis 5 leads to approximately 222 requests per second, each one executing several SHA512 based KDF iterations on each string.

RedRoom logo

Acknowledgements

RedRoom is Copyright (C) 2019 by the Dyne.org foundation

Written and maintained by Denis Roio [email protected] and co-designed with Andrea D'Intino

License

RedRoom is Copyright (c) 2019 by the Dyne.org foundation

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

redroom's People

Contributors

andrea-dintino avatar jaromil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.