update readme
This commit is contained in:
parent
1810eef15a
commit
14e667ad20
@ -1,20 +1,22 @@
|
|||||||
## Open quantum safe OpenSSL 1.1.1t
|
# Open quantum safe OpenSSL 1.1.1t
|
||||||
|
|
||||||
:red_circle: OpenSSL 1.1.1 End of life - https://www.openssl.org/blog/blog/2023/09/11/eol-111/
|
## :heavy_exclamation_mark: :heavy_exclamation_mark: :heavy_exclamation_mark: OpenSSL 1.1.1 End of life - https://www.openssl.org/blog/blog/2023/09/11/eol-111/ :heavy_exclamation_mark: :heavy_exclamation_mark: :heavy_exclamation_mark:
|
||||||
|
|
||||||
## Building
|
## **"The OpenSSL project has announced that its support for OpenSSL 1.1.1 will stop in September, 2023, and that all users should switch to OpenSSL 3. Consequently, the Open Quantum Safe project is discontinuing development of our OQS-OpenSSL 1.1.1 fork."** - https://github.com/open-quantum-safe/openssl
|
||||||
### LINUX
|
|
||||||
- testované na Ubuntu 20.04.5
|
|
||||||
|
|
||||||
**1. Inštalácia potrebných nástrojov**
|
# Building
|
||||||
|
Inštalované a testované na:
|
||||||
|
| Platform | OS | compiler | cmake | ninja |
|
||||||
|
|:-----------------:|:---------------------------:|:------------------------------------------------:|:-------:|:-------:|
|
||||||
|
| Linux | Ubuntu 20.04.5 LTS <br> (GNU/Linux 5.15.133.1-microsoft-standard-WSL2 x86_64) | gcc version 11.4.0 <br> (Ubuntu 11.4.0-1ubuntu1~22.04) | version 1.10.1 | version 3.16.3 |
|
||||||
|
|
||||||
|
## LINUX
|
||||||
|
|
||||||
|
#### 1. Inštalácia potrebných nástrojov
|
||||||
|
|
||||||
```sudo apt install cmake gcc libtool libssl-dev make ninja-build git -y```
|
```sudo apt install cmake gcc libtool libssl-dev make ninja-build git -y```
|
||||||
|
|
||||||
**2. Stiahnutie Open Quantum Safe OpenSSL repozitáru**
|
#### 2. Stiahnutie a inštalácia liboqs
|
||||||
|
|
||||||
```git clone --branch OQS-OpenSSL_1_1_1-stable https://github.com/open-quantum-safe/openssl.git```
|
|
||||||
|
|
||||||
**3. Stiahnutie a inštalácia liboqs**
|
|
||||||
|
|
||||||
```
|
```
|
||||||
git clone --branch main https://github.com/open-quantum-safe/liboqs.git
|
git clone --branch main https://github.com/open-quantum-safe/liboqs.git
|
||||||
@ -24,47 +26,27 @@ cmake -GNinja -DCMAKE_INSTALL_PREFIX=../../openssl/oqs ..
|
|||||||
ninja
|
ninja
|
||||||
ninja install
|
ninja install
|
||||||
```
|
```
|
||||||
**4. Build QS OpenSSL fork**
|
#### 3. Stiahnutie a inštalácia OQS-OpenSSL
|
||||||
|
|
||||||
```
|
```
|
||||||
|
git clone --branch OQS-OpenSSL_1_1_1-stable https://github.com/open-quantum-safe/openssl.git
|
||||||
cd ./openssl
|
cd ./openssl
|
||||||
./Configure no-shared linux-x86_64 -DOQS_DEFAULT_GROUPS=\"kyber1024:p521_kyber1024:kyber90s1024:p521_kyber90s1024\" -lm
|
./Configure no-shared linux-x86_64 -lm
|
||||||
make -j 1
|
make -j 1
|
||||||
sudo make install
|
sudo make install
|
||||||
```
|
```
|
||||||
- prepínač `-DOQS_DEFAULT_GROUPS` umožňuje meniť key exchange algoritmy, ktoré bude server podporovať
|
|
||||||
- zoznam všetkých podporovaných algoritmov - https://github.com/open-quantum-safe/openssl#key-exchange
|
|
||||||
|
|
||||||
**5. Vytvorenie CA kľúča a certifikátu**
|
## WINDOWS
|
||||||
- v tomto príklade je *p256_dilithium2* hybridný algoritmus *dilithium2* s použitím P256 ECDH krivkou
|
Inštalované a testované na:
|
||||||
|
| Platform | OS | compiler | cmake | ninja | Perl | Build Tools </br>for Visual Studio 2022 |
|
||||||
|
|:-----------------:|:---------------------------:|:------------------------------------------------:|:-------:|:-------:|:------:|:---:|
|
||||||
|
| Windows | Windows 10.0.19043 | gcc version 13.2.0<br> (MinGW-W64 x86_64-msvcrt-posix-seh) | version 1.11.1 | version 3.27.1 | 5.32.1 | 17.5.5
|
||||||
|
|
||||||
```
|
#### 1. Príprava prostredia
|
||||||
cd ./openssl/apps
|
|
||||||
./openssl req -x509 -new -newkey p256_dilithium2 -keyout p256_dilithium2_CA.key -out p256_dilithium2_CA.crt -nodes -subj "/CN=oqstest CA" -days 365 -config ./openssl.cnf
|
|
||||||
```
|
|
||||||
**6. Vygenerovanie privátneho kľúča pre server**
|
|
||||||
```
|
|
||||||
./openssl req -new -newkey p256_dilithium2 -keyout p256_dilithium2_srv.key -out p256_dilithium2_srv.csr -nodes -subj "/CN=localhost" -config ./openssl.cnf
|
|
||||||
```
|
|
||||||
**7. Vygenerovanie certifikátu s CA podpisom pre server**
|
|
||||||
```
|
|
||||||
./openssl x509 -req -in p256_dilithium2_srv.csr -out p256_dilithium2_srv.crt -CA p256_dilithium2_CA.crt -CAkey p256_dilithium2_CA.key -CAcreateserial -days 365
|
|
||||||
```
|
|
||||||
**8. Spustenie serveru a klienta**
|
|
||||||
- oba programy je potrebné spustiť v samostatných oknách terminálu
|
|
||||||
```
|
|
||||||
./openssl s_server -cert p256_dilithium2_srv.crt -key p256_dilithium2_srv.key -www -tls1_3
|
|
||||||
./openssl s_client -groups kyber1024 -CAfile p256_dilithium2_CA.crt -connect localhost
|
|
||||||
```
|
|
||||||
|
|
||||||
### WINDOWS
|
GCC, ninja, CMake - súťasťou knižnice Winlibs - https://winlibs.com/
|
||||||
- testované na Windows 10.0.19043
|
|
||||||
|
|
||||||
**1. Príprava prostredia**
|
Perl - stiahnutie a inštalácia Perl-u strawberry-perl-5.32.1.1-64bit zo stránky https://strawberryperl.com/
|
||||||
|
|
||||||
Perl - stiahnutie Perl-u strawberry-perl-5.32.1.1-64bit zo stránky https://strawberryperl.com/
|
|
||||||
|
|
||||||
Cmake - stihnutie CMake-u cmake-3.26.3-windows-x86_64 zo stránky https://cmake.org/download/
|
|
||||||
|
|
||||||
NMAKE - stiahnutie a inštalácia nástrojov Build Tools for Visual Studio 2022 zo stránky https://visualstudio.microsoft.com/downloads/
|
NMAKE - stiahnutie a inštalácia nástrojov Build Tools for Visual Studio 2022 zo stránky https://visualstudio.microsoft.com/downloads/
|
||||||
|
|
||||||
@ -74,7 +56,7 @@ D:\Strawberry\perl\bin
|
|||||||
D:\Program Files\CMake\bin
|
D:\Program Files\CMake\bin
|
||||||
D:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.35.32215\bin\Hostx86\x86\nmake.exe
|
D:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.35.32215\bin\Hostx86\x86\nmake.exe
|
||||||
```
|
```
|
||||||
pozn. v našom prípade premenná nepomohla a bolo nutné ich nekonfigurovať manuálne v Powershelli príkazmi:
|
V našom prípade systémová premenná nepomohla a bolo nutné ich nekonfigurovať manuálne v Powershell termináli príkazmi:
|
||||||
```
|
```
|
||||||
$env:path += ";D:\Program Files\cmake\bin"
|
$env:path += ";D:\Program Files\cmake\bin"
|
||||||
$env:path += ";d:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.35.32215\bin\Hostx86\x86\"
|
$env:path += ";d:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.35.32215\bin\Hostx86\x86\"
|
||||||
@ -82,19 +64,13 @@ $env:path += ";d:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC
|
|||||||
Pre správnu funkciu NMAKE je nutné spustiť súbor vcvarsall.bat <br>
|
Pre správnu funkciu NMAKE je nutné spustiť súbor vcvarsall.bat <br>
|
||||||
V našom prípade sa tento súbor nachádzal na adrese `d:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\`
|
V našom prípade sa tento súbor nachádzal na adrese `d:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\`
|
||||||
|
|
||||||
**2. Stiahnutie OpenSSL, Open Quantum Safe OpenSSL repozitáru a liboqs**
|
#### 2. Stiahnutie OQS-OpenSSL a liboqs
|
||||||
|
|
||||||
OpenSSL - stiahnutie OpenSSL 1.1.1t zo stránky - https://www.openssl.org/source/ <br>
|
|
||||||
Stiahnutý súbor sme extrahovali do priečinka ProgramFiles a premenovali sme ho na openssl
|
|
||||||
|
|
||||||
OpenSSL OQS - stiahnutie OQS OpenSSL repozitáru z GITu - https://github.com/open-quantum-safe/openssl/tree/OQS-OpenSSL_1_1_1-stable <br>
|
OpenSSL OQS - stiahnutie OQS OpenSSL repozitáru z GITu - https://github.com/open-quantum-safe/openssl/tree/OQS-OpenSSL_1_1_1-stable <br>
|
||||||
Presun stiahnutých súborov do openssl priečinku
|
|
||||||
|
|
||||||
Liboqs - stiahnutie súborov z GITu - https://github.com/open-quantum-safe/liboqs
|
Liboqs - stiahnutie súborov z GITu - https://github.com/open-quantum-safe/liboqs
|
||||||
|
|
||||||
**3. Príprava liboqs**
|
#### 3. Príprava liboqs
|
||||||
- v prípade chyby prístupu pri príkaze cmake alebo ninja je potrebné spustiť PowerShell ako administrátor
|
|
||||||
- v našom prípade sme použili Administrator Developer PowerShell for VS 2022
|
|
||||||
```
|
```
|
||||||
cd liboqs
|
cd liboqs
|
||||||
mkdir build
|
mkdir build
|
||||||
@ -111,15 +87,35 @@ perl Configure VC-WIN64A no-shared
|
|||||||
nmake
|
nmake
|
||||||
```
|
```
|
||||||
|
|
||||||
pozn. chyba spôsobená chýbajúcim nalinkovaním Perlu a NMAKE-u (vyriešené spustením súboru vcvarsall.bat)
|
# Launch
|
||||||
![err-code](https://ctrlv.sk/shots/2023/05/09/QHGf.png)
|
|
||||||
|
|
||||||
**5. Príprava certifikátu, kľúčov a spustenie programov**
|
**1. Vytvorenie CA kľúča a certifikátu**
|
||||||
|
- v tomto príklade predstavuje *p256_dilithium2* hybridný algoritmus *dilithium2* v kombinácii si krivkou *p256* ECDSA algorimu
|
||||||
|
|
||||||
Generovanie certifikátu, kľúčov a spustenie programov je rovnaké ako na platforme UNIX - viď. bod 5-8 <br>
|
```
|
||||||
Výsledok je rovnaký
|
cd ./openssl/apps
|
||||||
|
./openssl req -x509 -new -newkey p256_dilithium2 -keyout p256_dilithium2_CA.key -out p256_dilithium2_CA.crt -nodes -subj "/CN=oqstest CA" -days 365 -config ./openssl.cnf
|
||||||
![final-result](https://ctrlv.sk/shots/2023/05/10/SzvJ.png)
|
```
|
||||||
|
**2. Vygenerovanie privátneho kľúča pre server**
|
||||||
|
```
|
||||||
|
./openssl req -new -newkey p256_dilithium2 -keyout p256_dilithium2_srv.key -out p256_dilithium2_srv.csr -nodes -subj "/CN=localhost" -config ./openssl.cnf
|
||||||
|
```
|
||||||
|
**3. Vygenerovanie certifikátu s CA podpisom pre server**
|
||||||
|
```
|
||||||
|
./openssl x509 -req -in p256_dilithium2_srv.csr -out p256_dilithium2_srv.crt -CA p256_dilithium2_CA.crt -CAkey p256_dilithium2_CA.key -CAcreateserial -days 365
|
||||||
|
```
|
||||||
|
**4. Spustenie serveru a klienta**
|
||||||
|
- oba programy je potrebné spustiť v samostatných oknách terminálu
|
||||||
|
```
|
||||||
|
./openssl s_server -cert p256_dilithium2_srv.crt -key p256_dilithium2_srv.key -www -tls1_3
|
||||||
|
./openssl s_client -groups kyber1024 -CAfile p256_dilithium2_CA.crt -connect localhost
|
||||||
|
```
|
||||||
|
|
||||||
## References
|
## References
|
||||||
[Open quantum safe OpenSSL 1.1.1t](https://github.com/open-quantum-safe/openssl)
|
[Open quantum safe OpenSSL 1.1.1t](https://github.com/open-quantum-safe/openssl)
|
||||||
|
|
||||||
|
[liboqs](https://github.com/open-quantum-safe/liboqs)
|
||||||
|
|
||||||
|
[WinLibs](https://winlibs.com/)
|
||||||
|
|
||||||
|
[Strawberry Perl](https://strawberryperl.com/)
|
||||||
|
Loading…
Reference in New Issue
Block a user