# Notes on Plain Text Export & Import

Warning: The Export of sensitive information from a Password Safe database to a text file has serious security consequences. This operation will create an unprotected copy of the passwords in the database. Deleting this copy after use is not sufficient and other actions should be taken to properly erase the data (e.g. third party “shredding” utilities). The export of sensitive data effectively bypasses the security of the Password Safe program.

Note: The Export and Import to/from text files feature has been changed in V3.06. This page describes the current format.

Exported text will:

- Begin with a Title Row as the first record in the text file
- Use a delimiter to replace the “newline” character in a multi-line Notes field and the period (‘.’) if present in the Title field. The default is ‘»’ [Alt+0187], which may be overridden if needed.

Imported text is assumed to have:

- A Title Row as the first record in the text file.
- A delimiter to reinstate the “newline” character in a multi-line Notes field and the period (‘.’), if present, in the Title field. The default is ‘»’ [Alt+0187], which may be overridden if needed.

The Title Row for full data export currently contains the following fields by default, separated by a tab.

- Group/Title
- Username
- Password
- URL
- AutoType
- Created Time
- Password Modified Time
- Last Access Time
- Password Expiry Date
- Record Modified Time
- History
- Notes

When exporting data, you may use the “Advanced” feature to exclude any number of these fields from the Title Row and records. The Advanced option also allows you to specify a subset of the entries to export, as shown below.

During Import, the supplied Title Row must include “column headings” that match exactly one of the above. If any “column heading” is repeated, only the data in the last one will be added to the entries during import. If a “column heading” does not match one of the above, the data in that column will be ignored during import. The fields must be separated with the field separator specified for the data in the Import Text dialog box.

Notes:

- To import any data into Password Safe, the Title and Password fields must be present and neither blank nor empty, as it would be if adding a new entry to an existing database.

- There is no restriction on the order of the “column headings”. Password Safe will use the supplied Title Row to correctly add the specified data to the right field.

## Data Formats

Column Heading/Field | Comments
Group/Title | If present, groups are separated by periods (‘.’). The Title field cannot be blank, empty or contain the delimiter character.
Username |
Password | Cannot be blank or empty.
URL |
AutoType |
Created Time | See note 1 below
Password Modified Time | See note 1 below
Last Access Time | See note 1 below
Password Expiry Date | See note 1 below
Record Modified Time | See note 1 below
History | See note 2 below
Notes | The Notes field should be enclosed by double quotes ("like this"). The Notes field should not contain the delimiter character since on import it will be translated to a newline.

Notes:

1 | Time fields can be one of the following 3 formats:

1. yyyy/mm/dd hh:mm:ss e.g., 2007/01/26 19:31:25
2. ddd MMM dd hh:mm:ss yyyy e.g., Fri Jan 26 19:31:25 2007
3. yyyy-mm-ddThh:mm:ss e.g., 2007-01-26T19:31:25
4. 0 Leave the field unset
5. now Use the time of the import operation

where:

- yyyy The year in full. Value is between 1970 and 2038.
- mm The month; e.g. 01 = January, 02 = February etc.
- dd The day of the month
- MMM The short form of the month; e.g. Jan = January, Feb = February etc.
- ddd The short form of the day of the week; e.g. Mon = Monday, Tue = Tuesday, etc.
- hh The hour using a 24-hour clock.
- mm The minutes
- ss The seconds

Note: Format ‘2’ is the output from the ANSI C function ‘`asctime`’ and format ‘3’ conforms to the ISO 8601 standard.

2 | Password history is represented in the exported entry record as a text field comprising a header followed by the required number of entries of old passwords:

Password History Header:

- 1 hexadecimal digit status for saving PWH for this entry (0 = no; 1 = yes)
- 2 hexadecimal digits maximum number of entries in this entry
- 2 hexadecimal digits number of entries currently saved

Each Password History Entry:

- 8 hexadecimal digits time old password was set
- 4 hexadecimal digits length of old password
- character string old password