Mind Expression Docs
English
  • Mind Expression Docs
  • Why Mind Expression
  • Quickstarts
    • Create Scope
    • Add Subject
    • Test
    • Audit
  • Concepts
    • Scopes
    • Subjects
    • Components
    • Sandbox
    • Conversation history
    • Webhooks and escalation
    • Knowledge
    • Live Chat
    • Target Messages
    • Analytics
  • How-to Guides
    • Set up webhooks and escalation
    • Manage global keys
    • Customize messages
    • Educate AI
      • Manage ontologies
      • Recognition Check
      • Semantic Relations
      • Manage entities
    • Steps
    • Components
      • Normal Components
        • Conditions
        • Selection Classes
        • Parameter Bundles
      • Response Components
        • Component Actions
    • Build Q&A Subjects
      • Case 1. Online Payment
      • Case 2. Data Plans
    • Build Info Search Subjects
      • Case 1. Data Usage
      • Case 2. Payment History
    • Build Query Freestyle Subjects
      • Case 1. Data Purchase
      • Case 2. Change Mobile Plan
    • Intelligent Process
      • Introduction to Mindscript
      • Mindscript with Mind Expression
      • Frequently Asked Question
      • Package: Collections and Sequenceable
      • Package: Collections Unordered
      • Package: Collections-Strings
      • Package: Engine-Conversation
      • Package: Kernel-HTTP
      • Package: Kernel-Methods
      • Package: Kernel-Numbers
      • Package: Kernel-Dates
      • Package: Kernel-Objects
      • Package: Kernel Exceptions
      • Package: Cryptography
    • Test and debug
    • Integration
      • Mind Expression API
      • Chat Widget
      • LINE
      • Facebook Messenger
      • Viber
      • Instagram
      • Discord
      • WhatsApp
      • Google Sheet
        • Google Sheet Webhook
      • Google Calendar
        • Google Calendar Webhook
        • Google Calendar: Use Cases
    • Audit AI Activities
    • Live Chat
    • Target Messages
    • Back up, import and restore Scopes
  • Reference
    • Glossary
    • API Docs
Powered by GitBook
On this page
  • Class: BCrypt
  • Introduction
  • Instance Method

Was this helpful?

  1. How-to Guides
  2. Intelligent Process

Package: Cryptography

Class: BCrypt

Introduction

Environment: container

Bcrypt is a cryptographic hash function designed for password hashing and safe storing in the backend of applications in a way that is less susceptible to dictionary-based cyberattacks.

It accepts the following attributes

  • identifier: the hash alogorithm identifier, it can be '2a' or '2b'. The default value is '2b'.

  • password: The plain text password to be hashed.

  • round: A numeric cost is added in front of the salt and the password hashes, showing how many password iterations were made before the hash was generate. The default value is 12.

  • salt: A 16-byte salt value is added in front of the plain text password, it is random by default.

After configuring the attributes, the token method can be leveraged to obtain the hashed password.

For example:

bcrypt := BCrypt new.
bcrypt identifier: '2b'.
bcrypt password: 'password'.
bcrypt salt: #[40 38 165 61 211 214 154 81 150 63 16 222 93 78 171 1].
bcrypt round: 10.

" The hashed password can be added to a web hook's http header as follows in a talk rule: "
self httpHeaders at: 'authentication' put: bcrypt token.

Instance Method

Category: accessing

  • identifier - Get the identifier of the BCrypt.

  • identifier: - Set the identifier of the BCrypt.

  • password - Get the password of the BCrypt.

  • password: - Set the password of the BCrypt.

  • round - Get the round of the BCrypt.

  • round: - Set the round of the BCrypt.

  • salt - Get the salt of the BCrypt.

  • salt: - Set the salt of the BCrypt.

Category: encode

  • token - Answer the hashed password as a string.

    For example:

    bcrypt := BCrypt new.
    bcrypt password: 'password'.
    bcrypt token.
PreviousPackage: Kernel ExceptionsNextTest and debug

Last updated 1 year ago

Was this helpful?