Crypt::FNA 0.74
===============

Crypt::FNA implements Mario Rossano's Fractal Numerical Algorithm. It
maps byte strings to coordinates on a curve defined by an ordered list of
angles. A post-quantum handshake establishes a session in which two peers
derive the same angles and authenticate salted FNA records in both directions.

The 0.74 examples authenticate both peers with trust on first use (TOFU).
Each starts with a persistent local ML-DSA-65 private key and sends its
public key during the handshake. An operator approves a new contact's
SHA-256 fingerprint. After cryptographic key confirmation the program
records it locally. Later connections check the recorded fingerprint and
stop on a change. Comparing fingerprints over an independent trusted
channel authenticates the first contact. WITHOUT that comparison, an
active intermediary can be accepted on the first connection.

ML-KEM-768 establishes a fresh secret per connection. ML-DSA-65 signs
the exchange. HKDF derives session directions and distinct authentication
keys. Each record carries a fresh 16-byte FNA salt. The confidentiality
of the historical geometric cipher remains experimental.

Requirements and installation
-----------------------------

For the 0.74 handshake use the OpenSSL 3.5.10 CLI or a later compatible
release with ML-KEM-768 and ML-DSA-65 enabled. The module invokes openssl
on PATH. The examples target POSIX systems with /dev/stdin, /dev/stdout,
/dev/tty and IO::Socket::IP. The TOFU directory uses a local filesystem
supporting hard links. The historical Perl coordinate API can be used
independently. Historical salted mode also needs openssl rand. Drawing
requires GD::Simple and the historical file digest uses Tie::File.

    openssl version
    openssl list -kem-algorithms
    openssl list -signature-algorithms
    perl Makefile.PL
    make test
    make install

The test harness reports skipped checks if its optional PQ backend is
missing. To exercise real chat processes on Linux, run the optional
Python 3 standard-library test after selecting OpenSSL on PATH:

    python3 xt/tofu_chat.py

Two computers
-------------

You can run the examples straight from the unpacked distribution. See
examples/README.md for the English key setup and Guida_FNA_0.74_TOFU.md
for the Italian Ubuntu installation, migration and two-VM walkthrough.
Generate one identity on each computer. Install a copy of this release on
both. Alice listens first. Replace the example IP with Alice's actual LAN
address in both commands. From examples/:

    perl alice.pl --listen 192.168.1.20 --port 4072

On Bob's machine:

    perl bob.pl --host 192.168.1.20 --port 4072 --directions 16

On first use Alice is prompted first and Bob second. Compare the displayed
fingerprints as appropriate and type yes in each terminal to accept. Once
connected, press Enter to send a line or type /quit to close. The recipient
sees all the ciphertext coordinates on one logical line and the recovered
text on the next. On one computer the default host is 127.0.0.1:4072.

Perl API and compatibility
--------------------------

    perldoc lib/Crypt/FNA.pm

The manual covers identity_hello, identity_fingerprint, the tofu option
to the handshake, the session API and the original coordinate interface.
Both peers select their trust policy locally. The explicit peer_public_key
API and --peer-public-key FILE example mode still interoperate with the 0.72
pre-provisioned protocol. The 0.72 wire specification remains available in
Procedura_scambio_FNA_0.72.md. See Changes for revision history and LICENSE
for copyright and licensing terms.
