Discuss this help topic in SecureBlackbox Forum

TElBCrypt.EncryptPassword

TElBCrypt     See also     


Filter: C#/Java  VB.NET  Pascal  C++  PHP  


Encrypts the password.

Declaration

[C#/Java]
    static string EncryptPassword(string Password);
    static string EncryptPassword(string Password, byte[] Salt);
    static string EncryptPassword(string Password, byte[] Salt, int Rounds);

[VB.NET]
    Shared Function EncryptPassword(ByVal Password As String) As String
    Shared Function EncryptPassword(ByVal Password As String, ByVal Salt As Byte()) As String
    Shared Function EncryptPassword(ByVal Password As String, ByVal Salt As Byte(), ByVal Rounds As Integer) As String

[Pascal]
    class function EncryptPassword(const Password : string) : string;
    class function EncryptPassword(const Password : string; Salt : ByteArray) : string;
    class function EncryptPassword(const Password : string; Salt : ByteArray; Rounds : integer) : string;

[C++]
    static void EncryptPassword(const std::string &Password, std::string &OutResult);
    static void EncryptPassword(const std::string &Password, const std::vector<uint8_t> &Salt, std::string &OutResult);
    static void EncryptPassword(const std::string &Password, const std::vector<uint8_t> &Salt, int32_t Rounds, std::string &OutResult);

[PHP]
    string EncryptPassword(string $Password)
    string EncryptPassword(string $Password, array of byte|string|NULL $Salt)
    string EncryptPassword(string $Password, array of byte|string|NULL $Salt, integer $Rounds)

Parameters

  • Password - the password to be encrypted.
  • Salt - the salt value to be used in encryption.By default, it is generated by GenerateSalt.
  • Rounds - Specifies the number of encryption rounds. The default value is 10.

Return value

    Returns the encrypted password (password hash).

Description

    Use this method to encrypt your password. It is recommended that you use the default salt value (generated by GenerateSalt), but custom values may be provided as well. The more encryption rounds, the longer encryption takes, but the better security against brute-force attacks.

See also:     GenerateSalt    

Discuss this help topic in SecureBlackbox Forum