Documentation ¶
Index ¶
- Constants
- func BytesSha256(v []byte) string
- func DecryptAESSimple(password []byte, encText string) ([]byte, error)
- func EncryptAESSimple(password []byte, data []byte, rounds int) (string, error)
- func PronouncablePassword(len int) string
- func PronouncablePasswordExt(rng io.Reader, pwlen int) (string, float64)
- func PronouncablePasswordSeeded(seed int64, len int) string
- func StrSha256(v string) string
- type PassHash
- func HashPassword(plainpass string, totpSecret []byte) (PassHash, error)
- func HashPasswordV0(plainpass string) (PassHash, error)
- func HashPasswordV1(plainpass string) (PassHash, error)
- func HashPasswordV2(plainpass string) (PassHash, error)
- func HashPasswordV3(plainpass string, totpSecret []byte) (PassHash, error)
- func HashPasswordV4(plainpass string, totpSecret []byte) (PassHash, error)
- func HashPasswordV5(plainpass string, totpSecret []byte) (PassHash, error)
- func (ph PassHash) Change(newPlainPass string) (PassHash, error)
- func (ph PassHash) ClearTOTP() (PassHash, error)
- func (ph PassHash) Data() (_version int, _seed []byte, _payload []byte, _totp bool, _totpsecret []byte, ...)
- func (ph PassHash) HasTOTP() bool
- func (ph PassHash) NeedsPasswordUpgrade() bool
- func (ph PassHash) String() string
- func (ph PassHash) Upgrade(plainpass string) (PassHash, error)
- func (ph PassHash) Valid() bool
- func (ph PassHash) Verify(plainpass string, totp *string) bool
- func (ph PassHash) WithTOTP(totpSecret []byte) (PassHash, error)
Constants ¶
View Source
const LatestPassHashVersion = 5
Variables ¶
This section is empty.
Functions ¶
func BytesSha256 ¶
func DecryptAESSimple ¶ added in v0.0.66
func EncryptAESSimple ¶ added in v0.0.66
func PronouncablePassword ¶ added in v0.0.374
func PronouncablePasswordExt ¶ added in v0.0.374
func PronouncablePasswordSeeded ¶ added in v0.0.374
Types ¶
type PassHash ¶ added in v0.0.47
type PassHash string
PassHash - [v0]: plaintext password ( `0|...` ) // simple, used to write PW's directly in DB - [v1]: sha256(plaintext) // simple hashing - [v2]: seed | sha256<seed>(plaintext) // add seed - [v3]: seed | sha256<seed>(plaintext) | [hex(totp)] // add TOTP support - [v4]: bcrypt(plaintext) | [hex(totp)] // use proper bcrypt - [v5]: bcrypt(sha512(plaintext)) | [hex(totp)] // hash pw before bcrypt (otherwise max pw-len = 72)
func HashPassword ¶ added in v0.0.47
func HashPasswordV0 ¶ added in v0.0.47
func HashPasswordV1 ¶ added in v0.0.47
func HashPasswordV2 ¶ added in v0.0.47
func HashPasswordV3 ¶ added in v0.0.47
func HashPasswordV4 ¶ added in v0.0.47
func HashPasswordV5 ¶ added in v0.0.171
func (PassHash) NeedsPasswordUpgrade ¶ added in v0.0.47
Click to show internal directories.
Click to hide internal directories.