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. πŸ’…βœ¨