GnuPG::Tie(3pm)
π GnuPG::Tie(3pm) π
okay so bestie, this one lives in the User Contributed Perl Documentation corner of your man pages, and it's literally the glow-up that lets you talk to the GNU Privacy Guard through a filehandle like it's no big deal. π«Ά
β¨ NAME β¨
GnuPG::Tie::Encrypt β Tied filehandle interface to encryption with the GNU Privacy Guard.
GnuPG::Tie::Decrypt β Tied filehandle interface to decryption with the GNU Privacy Guard.
πΈ SYNOPSIS πΈ
no cap, this is the whole vibe:
use GnuPG::Tie::Encrypt;
use GnuPG::Tie::Decrypt;
tie *CIPHER, 'GnuPG::Tie::Encrypt', armor => 1, recipient => 'User';
print CIPHER <<EOF;
This is a secret
EOF
local $/ = undef;
my $ciphertext = <CIPHER>;
close CIPHER;
untie *CIPHER;
tie *PLAINTEXT, 'GnuPG::Tie::Decrypt', passphrase => 'secret';
print PLAINTEXT $ciphertext;
my $plaintext = <PLAINTEXT>;
# $plaintext should now contains 'This is a secret'
close PLAINTEXT;
untie *PLAINTEXT;
π¦ DESCRIPTION π¦
GnuPG::Tie::Encrypt and GnuPG::Tie::Decrypt provides a tied file handle interface to encryption/decryption facilities of the GNU Privacy guard. β¨
With GnuPG::Tie::Encrypt everything you write to the file handle will be encrypted. You can read the ciphertext from the same file handle. π
With GnuPG::Tie::Decrypt you may read the plaintext equivalent of a ciphertext. This is one can have been written to file handle.
All options given to the tie constructor will be passed on to the underlying GnuPG object. You can use a mix of options to output directly to a file or to read directly from a file, only remember than once you start reading from the file handle you can't write to it anymore. β οΈ (fr fr, read and write do NOT share, it's giving one-way street energy)
π AUTHOR π
Francis J. Lacoste <francis.lacoste@Contre.COM>
π COPYRIGHT π
Copyright (c) 1999, 2000 iNsu Innovations Inc. Copyright (c) 2001 Francis J. Lacoste
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
π SEE ALSO π
and that's the whole page, bestie!! π this lil doc came from perl v5.36.0 dated 2022-10-13, and yeah, it's the GnuPG::Tie(3pm) page. periodt. ππ«Άβ¨
π¦ where this page comes from
- ubuntu noble: libgnupg-perl 0.19-5 Β· GPL-2.0-or-later
- ubuntu resolute: libgnupg-perl 0.19-5 Β· GPL-2.0-or-later
- ubuntu stonking: libgnupg-perl 0.19-5 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms