Code Monkey home page Code Monkey logo

yescrypt's Introduction

yescrypt

Build Status

This repository holds my implementations of the yescrypt algorithm done for Google Summer of Code 2015. WARNING: This code has not yet been brought up to date with the latest version of yescrypt, yescrypt 1.0. This is being tracked in GitHub Issue #32.

Documentation

Here are some useful yescrypt and scrypt links:

Optimization

Currently, none of the implementations are optimized.

Using a non-optimized implementation in production is a security weakness. This is because you are forced to use weaker parameters than you could have with an optimized implementation, and therefore the attacker has more of an advantage.

Use an optimized native implementation if possible.

Audit Status

None of the code in this repository has been professionally reviewed. The code here should be considered experimental and not used in production until this notice is removed.

Reporting Security Bugs

Please disclose bugs publicly by opening an issue on GitHub. If you need to disclose privately for some reason, or don't have a GitHub account, you can find my contact information here.

The ecmascript_simd polyfill

The polyfill for SIMD operations, in javascript/ecmascript_simd.js, was taken from tc38/ecmascript_simd and modified to support shiftRightLogicalByScalar on Int32x4.

Common API

Each of the yescrypt implementations provides the following command-line API:

yescrypt-cli <function> <args...>

Here, <function> can be one of the following:

  • yescrypt: Compute the yescrypt function using arguments password (hex encoded), salt (hex encoded), N, r, p, t, g, flags, and dkLen in that order.

  • pwxform: Compute the pwxform function on the arguments pwxblock (hex encoded) and sbox (hex encoded) in that order.

  • salsa20_8: Compute the salsa20 function reduced to 8 rounds on the hex-encoded cell provided as the next argument.

  • benchmark: Run a performance benchmark (see below for arguments.).

When <function> is benchmark, the next argument is the iteration count, and then further arguments can be:

  • yescrypt: Benchmark the yescrypt function, with the following arguments being N, r, p, t, g, flags, and dkLen in that order, printing the performance of computing yescypt with those parameters on random passphrases and salts in c/s.

  • pwxform: Benchmark the pwxform function on a random block and sbox, printing the result in c/s.

  • salsa20_8: Benchmark the salsa20_8 function on a random cell, printing the result in c/s.

Each implementation is expected to report its average performance for that many iterations of the requested function. Implementations should strive to return as accurate results as possible. If no meaningful accuracy is possible given the provided iteration count, the benchmark command may fail with an error message.

The rationale for making each implementation have their own timing code is that firstly, the overhead of process creation, etc. is not included in the running time, and secondly, that each language "knows best" how to benchmark itself.

The rationale for not letting implementations decide the iteration count for themselves is that the benchmark user is the one who decides how long they want to run the benchmarks for and what kind of accuracy they expect.

Funding

Taylor's work on this project was funded by Google Summer of Code and by 20% "fun friday" time at Zcash.

yescrypt's People

Contributors

defuse 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.