---
name: "key_setsecret"
section: "3"
platform: "linux"
package: "man-pages"
version: "6.19-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux", "freebsd"]
url: "https://new.carta.tech/key_setsecret"
---

# key\_setsecret(3)

interfaces to rpc keyserver daemon

## NAME

key\_decryptsession, key\_encryptsession, key\_setsecret, key\_gendes, key\_secretkey\_is\_set - interfaces to rpc keyserver daemon

## LIBRARY

Standard C library (*libc*, *-lc*)

## SYNOPSIS

```
#include <rpc/rpc.h>
```

**int key\_decryptsession(char \****remotename***, des\_block \****deskey***);** **int key\_encryptsession(char \****remotename***, des\_block \****deskey***);**

**int key\_gendes(des\_block \****deskey***);**

**int key\_setsecret(char \****key***);** **int key\_secretkey\_is\_set(void);**

## DESCRIPTION

The functions here are used within the RPC's secure authentication mechanism (AUTH\_DES). There should be no need for user programs to use this functions.

The function **key\_decryptsession**() uses the (remote) server netname and takes the DES key for decrypting. It uses the public key of the server and the secret key associated with the effective UID of the calling process.

The function **key\_encryptsession**() is the inverse of **key\_decryptsession**(). It encrypts the DES keys with the public key of the server and the secret key associated with the effective UID of the calling process.

The function **key\_gendes**() is used to ask the keyserver for a secure conversation key.

The function **key\_setsecret**() is used to set the key for the effective UID of the calling process.

The function **key\_secretkey\_is\_set**() can be used to determine whether a key has been set for the effective UID of the calling process.

## RETURN VALUE

These functions return 1 on success and 0 on failure.

## ATTRIBUTES

For an explanation of the terms used in this section, see [**attributes**(7)](/attributes/7.md).

| | | |
| --- | --- | --- |
| **Interface** | **Attribute** | **Value** |
| **key\_decryptsession**(), **key\_encryptsession**(), **key\_gendes**(), **key\_setsecret**(), **key\_secretkey\_is\_set**() | Thread safety | MT-Safe |

## NOTES

Note that we talk about two types of encryption here. One is asymmetric using a public and secret key. The other is symmetric, the 64-bit DES.

These routines were part of the Linux/Doors-project, abandoned by now.

## SEE ALSO

[**crypt**(3)](/crypt/3.md)
