Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Crypto helper #33

Closed
Tracked by #4
shahryarjb opened this issue Apr 13, 2024 · 0 comments
Closed
Tracked by #4

Add Crypto helper #33

shahryarjb opened this issue Apr 13, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@shahryarjb
Copy link
Member

shahryarjb commented Apr 13, 2024

Inspiration

  # https://github.com/dashbitco/nimble_totp/blob/master/lib/nimble_totp.ex#L259
  # It should support diffrent type of hashing from user selected
  # bcrypt - bcrypt_elixir https://hex.pm/packages/bcrypt_elixir
  # pbkdf2 - pbkdf2_elixir https://hex.pm/packages/pbkdf2_elixir
  # argon2 - argon2_elixir https://hex.pm/packages/argon2_elixir (recommended)
  #
  # boruta_auth/lib/boruta/oauth/request/base.ex

  # [
  #   "client_credentials",
  #   "password",
  #   "authorization_code",
  #   "refresh_token",
  #   "implicit",
  #   "revoke",
  #   "introspect"
  # ]

  # RS256: [type: :asymmetric, hash_algorithm: :SHA256, binary_size: 16]
  # RS384: [type: :asymmetric, hash_algorithm: :SHA384, binary_size: 24]
  # RS512: [type: :asymmetric, hash_algorithm: :SHA512, binary_size: 32]
  # HS256: [type: :symmetric, hash_algorithm: :SHA256, binary_size: 16]
  # HS384: [type: :symmetric, hash_algorithm: :SHA384, binary_size: 24]
  # HS512: [type: :symmetric, hash_algorithm: :SHA512, binary_size: 32]

  # def hash(string, client) do
  #   hash_alg(client)
  #   |> Atom.to_string()
  #   |> String.downcase()
  #   |> String.to_atom()
  #   |> :crypto.hash(string)
  #   |> binary_part(0, hash_binary_size(client))
  #   |> Base.url_encode64(padding: false)
  # end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant