# BCrypt

We provide helper for storing encrypted password. See example below:

```ruby
class User
  include Clear::Model
  primary_key :id, type: :uuid
  
  column encrypted_password : Crypto::Bcrypt::Password
  
  def password=(x)
    self.encrypted_password = Crypto::Bcrypt::Password.create(x)
  end  
end


# Create a new user with the password
User.create!({password: "helloworld"})

#...

# Get the created user
user = User.query.first

if user.encrypted_password.verify("thisisfalse") # < false
  #...
end

```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://clear.gitbook.io/project/additional-and-advanced-features/bcrypt.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
