Crypt::FNA 0.80
===============

Crypt::FNA implements Mario Rossano's Fractal Numerical Algorithm. The
symmetric FNA cipher maps messages and binary files to coordinates on a
curve defined by an ordered list of angles. The same geometry provides
file and scalar digests through mac and mac_scalar.

The chat 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.

The asymmetric component uses ML-KEM-768 to establish a fresh secret and
ML-DSA-65 to sign the exchange. HKDF-SHA256 initializes a separate chain
for each sender. In 0.80 each message uses a new FNA base with directions
in hundredths of a degree. The walk resumes at the last segment index
and coordinates for that sender. The negotiated direction count stays
constant. Each record has a fresh 16-byte FNA salt and a random magic
field of 16 to 64 bytes. Its encrypted trailer (for example, |32) tells
the other peer how many magic bytes to use in its next reply. A repeated
message can therefore occupy a different number of vertices. The security
of the symmetric geometric cipher remains experimental.

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

For the 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 standalone FNA interface works independently
of the handshake. Its salted mode uses openssl rand. Drawing requires
GD::Simple and the 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.80_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 the asymmetric key exchange, per-message direction
derivation, the symmetric file and scalar methods, and FNA digests.
Upgrade both endpoints to use the continuous path with either TOFU
or verified public PEMs. Reuse your existing identities and TOFU pins.
For a 0.75 peer select record_profile => 'ratchet' on the 0.80 endpoint
(chat option --record-profile ratchet).
To communicate with a 0.74 peer, explicitly set record_profile => 'fixed'
on the 0.80 endpoint (chat option --fixed-directions). For a 0.72 peer,
also select the pre-provisioned public PEM policy. The 0.72 wire
specification is in Procedura_scambio_FNA_0.72.md. See Changes for
revision history and LICENSE for copyright and licensing terms.
