key_setsecret(3)
π key_setsecret(3) β like, the whole crew of rpc keyserver besties π
okay bestie, welcome to section 3 of the Library Functions Manual π this page is about the whole squad: key_decryptsession, key_encryptsession, key_setsecret, key_gendes, and key_secretkey_is_set. they're all about talking to the rpc keyserver daemon, and like... they're kind of a lot. buckle up. π¦
β¨ NAME β¨
key_decryptsession, key_encryptsession, key_setsecret, key_gendes, key_secretkey_is_set β interfaces to rpc keyserver daemon π
π LIBRARY π
Standard C library β that's libc, -lc when you're linking. the classic. the icon. π
πΈ 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 π
so. these functions live inside RPC's secure authentication mechanism, aka AUTH_DES. and like, the manual itself is telling you: "There should be no need for user programs to use this functions." π not me being told to my face that I shouldn't be here. but here we are! let's learn it anyway, iykyk. π
key_decryptsession()β takes the (remote) server netname, and gets the DES key so you can decrypt. it uses the public key of the server, plus the secret key that's associated with the effective UID of the calling process. πkey_encryptsession()β literally the inverse ofkey_decryptsession(), no cap. it encrypts the DES keys using the public key of the server and the secret key associated with the effective UID of the calling process. πkey_gendes()β this one asks the keyserver for a secure conversation key. like sliding into the keyserver's DMs going "hey bestie, can i get a secure one?" πkey_setsecret()β sets the key for the effective UID of the calling process. it's giving main character energy: you're assigning yourself a secret. β¨key_secretkey_is_set()β the vibe check π«Ά use it to figure out whether a key has even been set for the effective UID of the calling process. returns whether it's set or not, and that's it.
π₯ RETURN VALUE π₯
they return 1 on success and 0 on failure. that's the whole thing. no errno drama, no negative numbers, just a 1 or a 0. periodt. π
π ATTRIBUTES π
if you don't know what "attributes" means in this context, go read attributes(7). quick recap incoming:
key_decryptsession(),key_encryptsession(),key_gendes(),key_setsecret(),key_secretkey_is_set()β Thread safety:MT-Safeπ
so basically: every single one of these is MT-Safe. all of them. the whole friend group is thread-safe, we love to see it. π
β NOTES β
okay so we're talking about two different kinds of encryption on this page, don't get it twisted:
- one is asymmetric β using a public key and a secret key ππ
- the other is symmetric β the 64-bit DES β¨
and a little lore drop for you: these routines were part of the Linux/Doors-project, which has been abandoned by now. rip to a real one π it's giving ancient relics, honestly.
π SEE ALSO π
and that's the page, bestie!! πΈ this was key_setsecret(3) from the Linux man-pages 6.20, dated 2026-02-08. mwah, drink some water, and remember: you probably don't need these functions. ππ¦β¨
π¦ where this page comes from
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages 6.20
- π the page's license: GPL-1.0-or-later
- Copyright 2002, Walter Harms <walter.harms@informatik.uni-oldenburg.de>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms