cryptopANT(3cryptopANT)
π NAME π
<cryptopANT> β IP Address Anonymization Library. That's it, that's the girlboss. π
β¨ SYNOPSIS β¨
#include <cryptopANT.h>
π¦ DESCRIPTION π¦
Okay bestie, so the cryptopANT ip address anonymization library is literally the blueprint for anonymizing IPv4 and IPv6 addresses, and the techniques were first described in:
'Prefix-Preserving IP Address Anonymization', Computer Networks, Volume 46, Issue 2, 7 October 2004, Pages 253-272, Elsevier.
which everyone knows as Crypto-PAn. Iconic behavior, no cap. π
This implementation is provided by the USC/ISI ANT project: http://ant.isi.edu π
π API Overview π
int scramble_init_from_file(const char *keyfile, scramble_crypt_t c4, scramble_crypt_t c6, int *do_mac)
Initializes the library from a keyfile and sets up the underlying cryptographical mechanism for scrambling IPv4 (c4) and IPv6 (c6) addresses. See scramble_crypt_t for the possible values of c4 and c6. The typically used ones are SCRAMBLE_NONE for no scrambling, or SCRAMBLE_AES for scrambling using the fast AES cypher. If the keyfile doesn't exist, it gets created. This function internally calls scramble_readstate() and scrable_init(). Returns 0 if successful. SCRAMBLE_BLOWFISH uses the blowfish cypher β and like, it was previously widely used, but it's no longer recommended, because scrambling of ipv6 addresses can be very slow. π
int32_t scramble_ip4(uint32_t input, int pass_bits)int32_t unscramble_ip4(uint32_t input, int pass_bits)
Scrambles or un-scrambles the (input) IP address, passing through the first (pass_bits), and the scrambled ip address is returned. Just so you know, even if (pass_bits) is 0, the first few bits will still be passed through to preserve the class of the input IP. Both the input and output IPs are in network byte order. Heads up: unscrambling is a costly operation, and unscrambling a large number of different addresses can take a long time. π
void scramble_ip6(struct in6_addr *input, int pass_bits)void unscramble_ip6(struct in6_addr *input, int pass_bits)
Scrambles or un-scrambles the IPv6 address pointed to by (input) in-place, passing through the first (pass_bits). Addresses are in network byte order. And same tea as before: unscrambling is a costly operation, and unscrambling a large number of different addresses can take a long time. π«
int scramble_readstate(const char *keyfile, scramble_state_t *s)int scramble_savestate(const char *keyfile, const scramble_state_t *s)
These functions can read scrambling keys from keyfile into memory pointed to by (s), or save/write previously initialized state (s) to a (keyfile). After the state is read, the library still needs to be initialized by calling scramble_init(). Returns 0 on success. β¨
int scramble_init(const scramble_state_t *s)
Initializes the library using the state pointed to by (s). Returns 0 on success. π
πΈ SEE ALSO πΈ
scramble_ips
is a binary for anonymizing textual IP addresses, which comes packaged with this library. Bestie, it's right there in the box, go use it. π
π AUTHORS π
The cryptopANT library was written by
- Yuri Pradkin, University of Southern California, Information Sciences Institute, CA.
The current version is available from "ANT Project"'s Web site at
π BUGS π
Please send problems, bugs, questions, desirable enhancements, etc. to:
- ant@isi.edu
fr fr, they want to hear from you β bugs, questions, glow-up ideas, all of it. π«Ά
Okay that's the whole page, babe. This one's dated 2024-01-24 and it's cryptopANT(3cryptopANT) β from the cryptopANT fam. Go anonymize something responsibly. Mwah. π
β¨
π¦ where this page comes from
- debian trixie: libcryptopant-dev 1.3.1-3 Β· GPL-2.0-only
- epel 10: cryptopant-devel 1.3.2-2.el10_2 Β· GPL-2.0-only
- epel 9: cryptopant-devel 1.3.2-3.el9 Β· GPL-2.0-only
- fedora 43: cryptopant-devel 1.3.2-2.fc43 Β· GPL-2.0-only
- fedora 43: cryptopant-devel 1.3.2-2.fc43 Β· GPL-2.0-only
- fedora 44: cryptopant-devel 1.3.2-5.fc44 Β· GPL-2.0-only
- fedora 44: cryptopant-devel 1.3.2-5.fc44 Β· GPL-2.0-only
- ubuntu questing: libcryptopant-dev 1.3.1-3
- ubuntu resolute: libcryptopant-dev 1.3.2-2 Β· GPL-2.0-only
- ubuntu stonking: libcryptopant-dev 1.3.2-2build1 Β· GPL-2.0-only
- Copyright (C) 2004-2024 by the University of Southern California
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms