This sample demonstrate the BB84 algorithm in Java.
Execute with
mvn clean javafx:run
This should show output similar to
Same bases used. Alice sent 1 and Bob received 1
Same bases used. Alice sent 0 and Bob received 0
Same bases used. Alice sent 1 and Bob received 1
Different bases used, ignore values false and true
Same bases used. Alice sent 1 and Bob received 1
Different bases used, ignore values false and true
Same bases used. Alice sent 1 and Bob received 1
Different bases used, ignore values true and true
Secret key = 10111
JavaFX Platform initialized
and a UI similar to this:
This code shows the BB84 algorithm for Quantum Key Distribution, implemented in Java. You can learn more about this sample in Chapter 8 of Quantum Computing for Java Developers. It is discussed in 8.6: "QKD in Java"