Crypt::FNA 0.72
===============

Crypt::FNA implements Mario Rossano's Fractal Numerical Algorithm (FNA).
The historical Perl interface maps byte strings to coordinates on a curve
defined by an ordered list of angles. Version 0.72 lets two peers derive
the same list during an authenticated key exchange, then send salted FNA
messages in either direction.

Bob creates an ephemeral ML-KEM-768 key pair. Alice encapsulates a secret
using Bob's public key, and Bob recovers it using his private key. Each
peer signs its part of the exchange with a persistent ML-DSA-65 identity.
Before connecting, each peer needs a verified copy of the other's public
identity key. The exchange derives the FNA directions and authentication
keys from the shared secret, both peers' salts and the handshake transcript.

Requirements
------------

* The historical coordinate API runs in Perl. Salted historical encryption
  also needs the openssl executable for random bytes. PNG drawing uses
  GD::Simple (the GD distribution). The legacy file digest uses Tie::File.
* The handshake and session examples require a POSIX system with /dev/stdin
  and /dev/stdout and OpenSSL 3.5 or later on PATH. Its provider must offer
  ML-KEM-768 and ML-DSA-65. Check the local installation with

      openssl version
      openssl list -kem-algorithms
      openssl list -signature-algorithms

* The two TCP examples also use IO::Socket::IP. Python is optional for the
  author interoperability check in xt/.

Installation
------------

From the extracted distribution, run

    perl Makefile.PL
    make
    make test
    make install

The test output identifies any checks skipped for missing external tools.
To read the full API before installing, run

    perldoc lib/Crypt/FNA.pm

After installation, run

    perldoc Crypt::FNA

Try the two-peer chat
---------------------

Open examples/README.md for the first-run key setup and two-terminal
walkthrough. Alice listens and Bob initiates the handshake. From the
distribution root, with the example keys in examples/chiavi/, run

    perl examples/alice.pl

In a second terminal run

    perl examples/bob.pl --direzioni 16

Type a line in either terminal and press Enter. Type /fine on its own line
to close the conversation. The examples use 127.0.0.1 and TCP port 4072 by
default. They are shipped as example programs. Both use the public Perl API.

Documentation
-------------

The module manual covers the four handshake calls, the session methods,
the original FNA interface and the curve recurrence. The Italian document
Procedura_scambio_FNA_0.72.md gives the byte layout and key derivation for
the v2 handshake. Changes lists revisions. See LICENSE for copyright and
licensing terms.

Security scope
--------------

ML-KEM-768 establishes the shared secret and ML-DSA-65 verifies the peer
identities. FNA supplies the geometric transformation for the message
body. The FNA protocol and the confidentiality of that transformation are
experimental. The session authenticates individual records. Applications
that require ordering or replay detection must track sequence numbers, as
the chat examples do.
