OpenBSD manual page server

Manual Page Search Parameters

DES_READ_PW(3) Library Functions Manual DES_READ_PW(3)

des_read_pw, des_read_pw_string, EVP_read_pw_stringcompatibility user interface functions

#include <openssl/ui_compat.h>

des_read_pw(char *buf, char *buff, int length, const char *prompt, int verify);

des_read_pw_string(char *buf, int length, const char *prompt, int verify);

#include <openssl/evp.h>

EVP_read_pw_string(char *buf, int length, const char *prompt, int verify);

The DES library contained a few routines to prompt for passwords. These aren't necessarily dependent on DES, and have therefore become part of the UI compatibility library.

des_read_pw() writes the string specified by prompt to standard output, turns echo off, and reads an input string from the terminal. The string is returned in buf, which must have space for at least length bytes. If verify is set, the user is asked for the password twice and unless the two copies match, an error is returned. The second password is stored in buff, which must therefore also be at least length bytes. A return code of -1 indicates a system error, 1 failure due to use interaction, and 0 is success.

des_read_pw_string() is a variant of des_read_pw() that provides a buffer if verify is set. It is available in the MIT Kerberos library as well. If length exceeds BUFSIZ, des_read_pw_string() uses BUFSIZ.

EVP_read_pw_string() is functionally similar to des_read_pw_string().


des_read_pw_string() appeared in SSLeay 0.4 or earlier. EVP_read_pw_string() first appeared in SSLeay 0.5.1. des_read_pw() first appeared in SSLeay 0.8.0. These functions have been available since OpenBSD 2.4.

Richard Levitte <> for the OpenSSL project.

March 27, 2018 OpenBSD-current