Skip to content

Latest commit

 

History

History
57 lines (41 loc) · 1002 Bytes

Other-Algorithms.md

File metadata and controls

57 lines (41 loc) · 1002 Bytes

Other Algorithms

PBKDF2-SHA256

Use:

class User < ApplicationRecord
  blind_index :email, algorithm: :pbkdf2_sha256
end

The default number of iterations is 10,000. For more sensitive fields, use:

class User < ApplicationRecord
  blind_index :email, algorithm: :pbkdf2_sha256, slow: true
end

This uses 100,000 iterations.

Argon2i

Add argon2 to your Gemfile and use:

class User < ApplicationRecord
  blind_index :email, algorithm: :argon2i
end

Set the cost parameters with:

class User < ApplicationRecord
  blind_index :email, algorithm: :argon2i, cost: {t: 4, m: 15}
end

scrypt

Add scrypt to your Gemfile and use:

class User < ApplicationRecord
  blind_index :email, algorithm: :scrypt
end

Set the cost parameters with:

class User < ApplicationRecord
  blind_index :email, algorithm: :scrypt, cost: {n: 4096, r: 8, p: 1}
end