pbkdf2

package module
v0.0.0-...-7a7c214 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 24, 2022 License: CC0-1.0 Imports: 3 Imported by: 0

README

pbkdf2

An optimized PBKDF2 implementation is particularly advantageous for a defender because an attacker will always have a more powerful setup.

This is an experiment in optimizing PBKDF2.

Every GOOS/GOARCH has the same base optimizations. GOARCH=arm64 has its own assembly core.

TODO: talk about optimizations.

=== RUN   Test100ms
    pbkdf2_test.go:120: std:  720311/100ms
    pbkdf2_test.go:121: asm: 1874573/100ms (2.60x)
[...]
BenchmarkHMACSHA256
BenchmarkHMACSHA256-8      	    5451	    219651 ns/op
BenchmarkHMACSHA256_Go
BenchmarkHMACSHA256_Go-8   	      84	  13853241 ns/op

Security

Disclosure

This project uses full disclosure. If you find a security bug in an implementation, please e-mail me or create a GitHub issue.

Disclaimer

You should only use cryptography libraries that have been reviewed by cryptographers or cryptography engineers. While I am a cryptography engineer, I'm not your cryptography engineer, and I have not had this project reviewed by any other cryptographers.

Documentation

Overview

Package pbkdf2 implements an optimized PBKDF2 (SHA-256 only).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Key

func Key(password, salt []byte, iter, keyLen int) []byte

Key derives a key from password, salt, and iteration count using PBKDF-HMAC-SHA256.

The key will be keyLen bytes long, etc. You know the rest.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL