Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vittoriopiotti/fermatandrsa-java
Soluzione software in Java che genera e salva su file i numeri primi con algoritmo di Fermat e algoritmo di crittografia RSA
https://github.com/vittoriopiotti/fermatandrsa-java
fermat fermat-factorization flatlaf java rsa rsa-cryptography rsa-decryption rsa-encryption software
Last synced: 2 months ago
JSON representation
Soluzione software in Java che genera e salva su file i numeri primi con algoritmo di Fermat e algoritmo di crittografia RSA
- Host: GitHub
- URL: https://github.com/vittoriopiotti/fermatandrsa-java
- Owner: vittorioPiotti
- License: gpl-3.0
- Created: 2024-08-21T20:11:56.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-10-21T01:13:08.000Z (4 months ago)
- Last Synced: 2024-10-21T04:36:50.171Z (4 months ago)
- Topics: fermat, fermat-factorization, flatlaf, java, rsa, rsa-cryptography, rsa-decryption, rsa-encryption, software
- Language: Java
- Homepage: https://drive.google.com/file/d/1IVb3ctowyLbrHMg7zlFN-Zv7If_51uzH/view?usp=sharing
- Size: 2.81 MB
- Stars: 27
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# Fermat-And-RSA
Soluzione software in Java che genera e salva su file i numeri primi con algoritmo di Fermat e algoritmo di crittografia RSA> [!NOTE]
> Progetto scolastico> [!Warning]
> Presenza di BUG nell'UI#### Support Me
[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/P5P012BC8U)
## Javadoc
Link al javadoc: [(link)](https://vittoriopiotti.altervista.org/FermatAndRsaJava/index.html)
## Preview
Video di Test [(link)](https://drive.google.com/file/d/1IVb3ctowyLbrHMg7zlFN-Zv7If_51uzH/view?usp=sharing)
---
## Responsive
|||
|-|-|
|Small|Large|## Utilizzo
1. Seleziona schermata di "Test Primalità"
2. Genera i numeri primi con algoritmo di Fermat
3. Salva su file i numeri primi
4. Seleziona schermata di "Algoritmo RSA"
5. Carica il file con i numeri primi
6. Cifra o decifra un messaggio## Snippet Fermat Algorithm
```java
public void algoritmoFermat(){
long start; //tempo inizio calcolo numeri primi
long end; //tempo fine calcolo numeri primi
boolean checkPrimo; //verifica se un numero è primo
//check = true: primo
//check = false: composto
start = System.currentTimeMillis(); //tempo inizio calcolo numeri primi
//ciclo for di i che scorre da min a max
for (
BigInteger i = min; //è il numero di cui si verifica la primalità
i.compareTo(max) <= 0;
i = i.add(BigInteger.valueOf(1))
) {
incrementProgressBar.run();
checkPrimo = true;
//ciclo for annidato di j che scorre da 2 al divisore massimo
for (
BigInteger j = BigInteger.valueOf(2); //è il dvisore del numero per la verifica della primalità
j.compareTo(BigInteger.valueOf(10)) <= 0; //j compareTo fino al numero
j = j.add(BigInteger.valueOf(1)))
//verifica se j divisore di i ed in caso aggiorna check = false
{
if (Thread.currentThread().isInterrupted()) {
end = System.currentTimeMillis(); //tempo fine calcolo numeri primi
time = Math.abs(start - end) / 1000.0; //tempo durata calcolo numeri primi
return;
}
if (!j.modPow(i.subtract(BigInteger.valueOf(1)), i).equals(BigInteger.valueOf(1))) checkPrimo = false;
}
if (checkPrimo){
results.add(i.toString());
appendResult.run();
}
}
end = System.currentTimeMillis(); //tempo fine calcolo numeri primi
time = Math.abs(start - end) / 1000.0; //tempo durata calcolo numeri primi
}```
## Albero di Path
```bash
$ tree
.
├──lib
│ └── flatlaf-3.2.5.jar
└──src
└── org
└── app
├── applications
│ ├── encryption
│ │ ├── ReadFile.java
│ │ └── TestEncryption.java
│ └── primality
│ ├── SavePrimality.java
│ └── TestPrimality.java
├── windows
│ ├── dependencies
│ │ ├── components
│ │ │ ├── encryption
│ │ │ │ ├── dialogs
│ │ │ │ │ ├── WinErrorInEncryption.java
│ │ │ │ │ └── WinErrorOutEncryption.java
│ │ │ │ ├── panels
│ │ │ │ │ ├── WinInEncryption.java
│ │ │ │ │ ├── WinOutEncryption.java
│ │ │ │ │ └── WinSaveEncryption.java
│ │ │ │ └── WinEncryption.java
│ │ │ ├── primality
│ │ │ │ ├── dialogs
│ │ │ │ │ ├── WinErrorInPrimality.java
│ │ │ │ │ └── WinErrorOutPrimality.java
│ │ │ │ ├── panels
│ │ │ │ │ ├── WinInPrimality.java
│ │ │ │ │ ├── WinOutPrimality.java
│ │ │ │ │ └── WinSavePrimality.java
│ │ │ │ └── WinPrimality.java
│ │ │ └── WinHome.java
│ │ └── managers
│ │ ├── WinManagerEncryption.java
│ │ └── WinManagerPrimality.java
│ └── WinManager.java
├── App.java
└── Main.java```
## Licenze
### Fermat And RSA
**Copyright** 2024 Vittorio Piotti [(GitHub page)](https://github.com/vittorioPiotti) [(Personal page)](https://vittoriopiotti.altervista.org/)
**Version** [v1.0.0](https://github.com/vittorioPiotti/FermatAndRSA-Java/releases/tag/1.0.0)
**License** [GPL-3.0](https://github.com/vittorioPiotti/Fermat-And-RSA/blob/main/LICENSE.md)
---
### FlatLaf
**Copyright** 2024 JFormDesigner GmbH
**Version** [v3.2.5](https://mvnrepository.com/artifact/com.formdev/flatlaf/3.2.5)
**License** [Apache License 2.0](https://github.com/JFormDesigner/FlatLaf/blob/main/LICENSE)