---
name: "File::KDBX::Constants"
section: "3pm"
platform: "linux"
package: "libfile-kdbx-perl"
version: "0.906-3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/File::KDBX::Constants"
---

# File::KDBX::Constants(3pm)

All the KDBX-related constants you could ever want

## NAME

File::KDBX::Constants - All the KDBX-related constants you could ever want

## VERSION

version 0.906

## SYNOPSIS

```
    use File::KDBX::Constants qw(:all);
    say KDBX_VERSION_4_1;
```

## DESCRIPTION

This module provides importable constants related to KDBX. Constants can be imported individually or in groups (by tag). The available tags are:

- •

  ":magic"

- •

  ":version"

- •

  ":header"

- •

  ":compression"

- •

  ":cipher"

- •

  ":random\_stream"

- •

  ":kdf"

- •

  ":variant\_map"

- •

  ":inner\_header"

- •

  ":key\_file"

- •

  ":history"

- •

  ":icon"

- •

  ":bool"

- •

  ":time"

- •

  ":yubikey"

- •

  `":all"` - All of the above

View the source of this module to see the constant values (but really you shouldn't care).

## FUNCTIONS

### to\_header\_constant

```
    $constant = to_header_constant($number);
    $constant = to_header_constant($string);
```

Get a header constant from an integer or string value.

### to\_compression\_constant

```
    $constant = to_compression_constant($number);
    $constant = to_compression_constant($string);
```

Get a compression constant from an integer or string value.

### to\_inner\_header\_constant

```
    $constant = to_inner_header_constant($number);
    $constant = to_inner_header_constant($string);
```

Get an inner header constant from an integer or string value.

### to\_icon\_constant

```
    $constant = to_icon_constant($number);
    $constant = to_icon_constant($string);
```

Get an icon constant from an integer or string value.

## CONSTANTS

### :magic

Constants related to identifying the file types:

- "KDBX\_SIG1"

  - "KDBX\_SIG1\_FIRST\_BYTE"

  - "KDBX\_SIG2\_1"

  - "KDBX\_SIG2\_2"

  ### :version

Constants related to identifying the format version of a file:

- "KDBX\_VERSION\_2\_0"

  - "KDBX\_VERSION\_3\_0"

  - "KDBX\_VERSION\_3\_1"

  - "KDBX\_VERSION\_4\_0"

  - "KDBX\_VERSION\_4\_1"

  - "KDBX\_VERSION\_OLDEST"

  - "KDBX\_VERSION\_LATEST"

  - "KDBX\_VERSION\_MAJOR\_MASK"

  - "KDBX\_VERSION\_MINOR\_MASK"

  ### :header

Constants related to parsing and generating KDBX file headers:

- "HEADER\_END"

  - "HEADER\_COMMENT"

  - "HEADER\_CIPHER\_ID"

  - "HEADER\_COMPRESSION\_FLAGS"

  - "HEADER\_MASTER\_SEED"

  - "HEADER\_TRANSFORM\_SEED"

  - "HEADER\_TRANSFORM\_ROUNDS"

  - "HEADER\_ENCRYPTION\_IV"

  - "HEADER\_INNER\_RANDOM\_STREAM\_KEY"

  - "HEADER\_STREAM\_START\_BYTES"

  - "HEADER\_INNER\_RANDOM\_STREAM\_ID"

  - "HEADER\_KDF\_PARAMETERS"

  - "HEADER\_PUBLIC\_CUSTOM\_DATA"

  ### :compression

Constants related to identifying the compression state of a file:

- "COMPRESSION\_NONE"

  - "COMPRESSION\_GZIP"

  ### :cipher

Constants related to ciphers:

- "CIPHER\_UUID\_AES128"

  - "CIPHER\_UUID\_AES256"

  - "CIPHER\_UUID\_CHACHA20"

  - "CIPHER\_UUID\_SALSA20"

  - "CIPHER\_UUID\_SERPENT"

  - "CIPHER\_UUID\_TWOFISH"

  ### :random\_stream

Constants related to memory protection stream ciphers:

- "STREAM\_ID\_RC4\_VARIANT"

  This is insecure and not implemented.

- "STREAM\_ID\_SALSA20"

  - "STREAM\_ID\_CHACHA20"

  - "STREAM\_SALSA20\_IV"

  ### :kdf

Constants related to key derivation functions and configuration:

- "KDF\_UUID\_AES"

  - "KDF\_UUID\_AES\_CHALLENGE\_RESPONSE"

  This is what KeePassXC calls `"KDF_AES_KDBX4"`.

- "KDF\_UUID\_ARGON2D"

  - "KDF\_UUID\_ARGON2ID"

  - "KDF\_PARAM\_UUID"

  - "KDF\_PARAM\_AES\_ROUNDS"

  - "KDF\_PARAM\_AES\_SEED"

  - "KDF\_PARAM\_ARGON2\_SALT"

  - "KDF\_PARAM\_ARGON2\_PARALLELISM"

  - "KDF\_PARAM\_ARGON2\_MEMORY"

  - "KDF\_PARAM\_ARGON2\_ITERATIONS"

  - "KDF\_PARAM\_ARGON2\_VERSION"

  - "KDF\_PARAM\_ARGON2\_SECRET"

  - "KDF\_PARAM\_ARGON2\_ASSOCDATA"

  - "KDF\_DEFAULT\_AES\_ROUNDS"

  - "KDF\_DEFAULT\_ARGON2\_ITERATIONS"

  - "KDF\_DEFAULT\_ARGON2\_MEMORY"

  - "KDF\_DEFAULT\_ARGON2\_PARALLELISM"

  - "KDF\_DEFAULT\_ARGON2\_VERSION"

  ### :variant\_map

Constants related to parsing and generating KDBX4 variant maps:

- "VMAP\_VERSION"

  - "VMAP\_VERSION\_MAJOR\_MASK"

  - "VMAP\_TYPE\_END"

  - "VMAP\_TYPE\_UINT32"

  - "VMAP\_TYPE\_UINT64"

  - "VMAP\_TYPE\_BOOL"

  - "VMAP\_TYPE\_INT32"

  - "VMAP\_TYPE\_INT64"

  - "VMAP\_TYPE\_STRING"

  - "VMAP\_TYPE\_BYTEARRAY"

  ### :inner\_header

Constants related to parsing and generating KDBX4 inner headers:

- "INNER\_HEADER\_END"

  - "INNER\_HEADER\_INNER\_RANDOM\_STREAM\_ID"

  - "INNER\_HEADER\_INNER\_RANDOM\_STREAM\_KEY"

  - "INNER\_HEADER\_BINARY"

  - "INNER\_HEADER\_BINARY\_FLAG\_PROTECT"

  ### :key\_file

Constants related to identifying key file types:

- "KEY\_FILE\_TYPE\_BINARY"

  - "KEY\_FILE\_TYPE\_HASHED"

  - "KEY\_FILE\_TYPE\_HEX"

  - "KEY\_FILE\_TYPE\_XML"

  ### :history

Constants for history-related default values:

- "HISTORY\_DEFAULT\_MAX\_AGE"

  - "HISTORY\_DEFAULT\_MAX\_ITEMS"

  - "HISTORY\_DEFAULT\_MAX\_SIZE"

  ### :iteration

Constants for searching algorithms.

- "ITERATION\_IDS" - Iterative deepening search

  - "ITERATION\_BFS" - Breadth-first search

  - "ITERATION\_DFS" - Depth-first search

  ### :icon

Constants for default icons used by KeePass password safe implementations:

- "ICON\_PASSWORD"

  - "ICON\_PACKAGE\_NETWORK"

  - "ICON\_MESSAGEBOX\_WARNING"

  - "ICON\_SERVER"

  - "ICON\_KLIPPER"

  - "ICON\_EDU\_LANGUAGES"

  - "ICON\_KCMDF"

  - "ICON\_KATE"

  - "ICON\_SOCKET"

  - "ICON\_IDENTITY"

  - "ICON\_KONTACT"

  - "ICON\_CAMERA"

  - "ICON\_IRKICKFLASH"

  - "ICON\_KGPG\_KEY3"

  - "ICON\_LAPTOP\_POWER"

  - "ICON\_SCANNER"

  - "ICON\_MOZILLA\_FIREBIRD"

  - "ICON\_CDROM\_UNMOUNT"

  - "ICON\_DISPLAY"

  - "ICON\_MAIL\_GENERIC"

  - "ICON\_MISC"

  - "ICON\_KORGANIZER"

  - "ICON\_ASCII"

  - "ICON\_ICONS"

  - "ICON\_CONNECT\_ESTABLISHED"

  - "ICON\_FOLDER\_MAIL"

  - "ICON\_FILESAVE"

  - "ICON\_NFS\_UNMOUNT"

  - "ICON\_MESSAGE"

  - "ICON\_KGPG\_TERM"

  - "ICON\_KONSOLE"

  - "ICON\_FILEPRINT"

  - "ICON\_FSVIEW"

  - "ICON\_RUN"

  - "ICON\_CONFIGURE"

  - "ICON\_KRFB"

  - "ICON\_ARK"

  - "ICON\_KPERCENTAGE"

  - "ICON\_SAMBA\_UNMOUNT"

  - "ICON\_HISTORY"

  - "ICON\_MAIL\_FIND"

  - "ICON\_VECTORGFX"

  - "ICON\_KCMMEMORY"

  - "ICON\_TRASHCAN\_FULL"

  - "ICON\_KNOTES"

  - "ICON\_CANCEL"

  - "ICON\_HELP"

  - "ICON\_KPACKAGE"

  - "ICON\_FOLDER"

  - "ICON\_FOLDER\_BLUE\_OPEN"

  - "ICON\_FOLDER\_TAR"

  - "ICON\_DECRYPTED"

  - "ICON\_ENCRYPTED"

  - "ICON\_APPLY"

  - "ICON\_SIGNATURE"

  - "ICON\_THUMBNAIL"

  - "ICON\_KADDRESSBOOK"

  - "ICON\_VIEW\_TEXT"

  - "ICON\_KGPG"

  - "ICON\_PACKAGE\_DEVELOPMENT"

  - "ICON\_KFM\_HOME"

  - "ICON\_SERVICES"

  - "ICON\_TUX"

  - "ICON\_FEATHER"

  - "ICON\_APPLE"

  - "ICON\_W"

  - "ICON\_MONEY"

  - "ICON\_CERTIFICATE"

  - "ICON\_SMARTPHONE"

  ### :bool

Boolean values:

- "FALSE"

  - "TRUE"

  ### :time

Constants related to time:

- "TIME\_SECONDS\_AD1\_TO\_UNIX\_EPOCH"

  ### :yubikey

Constants related to working with YubiKeys:

- "YUBICO\_VID"

  - "YUBIKEY\_PID"

  - "NEO\_OTP\_PID"

  - "NEO\_OTP\_CCID\_PID"

  - "NEO\_CCID\_PID"

  - "NEO\_U2F\_PID"

  - "NEO\_OTP\_U2F\_PID"

  - "NEO\_U2F\_CCID\_PID"

  - "NEO\_OTP\_U2F\_CCID\_PID"

  - "YK4\_OTP\_PID"

  - "YK4\_U2F\_PID"

  - "YK4\_OTP\_U2F\_PID"

  - "YK4\_CCID\_PID"

  - "YK4\_OTP\_CCID\_PID"

  - "YK4\_U2F\_CCID\_PID"

  - "YK4\_OTP\_U2F\_CCID\_PID"

  - "PLUS\_U2F\_OTP\_PID"

  - "ONLYKEY\_VID"

  - "ONLYKEY\_PID"

  - "YK\_EUSBERR"

  - "YK\_EWRONGSIZ"

  - "YK\_EWRITEERR"

  - "YK\_ETIMEOUT"

  - "YK\_ENOKEY"

  - "YK\_EFIRMWARE"

  - "YK\_ENOMEM"

  - "YK\_ENOSTATUS"

  - "YK\_ENOTYETIMPL"

  - "YK\_ECHECKSUM"

  - "YK\_EWOULDBLOCK"

  - "YK\_EINVALIDCMD"

  - "YK\_EMORETHANONE"

  - "YK\_ENODATA"

  - "CONFIG1\_VALID"

  - "CONFIG2\_VALID"

  - "CONFIG1\_TOUCH"

  - "CONFIG2\_TOUCH"

  - "CONFIG\_LED\_INV"

  - "CONFIG\_STATUS\_MASK"

  ## BUGS

Please report any bugs or feature requests on the bugtracker website \<https://github.com/chazmcgarvey/File-KDBX/issues\>

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

## AUTHOR

Charles McGarvey \<ccm@cpan.org\>

## COPYRIGHT AND LICENSE

This software is copyright (c) 2022 by Charles McGarvey.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
