Se creo una chiave privata tramite:
openssl req -x509 -newkey rsa:2048 -out cert.crt
quindi OpenSSL scrive la chiave privata nel file privkey.pem
e, se non si fornisce il parametro -nodes
, crittografa la chiave privata.
Quale crittografia predefinita è utilizzata?
Una chiave privata generata con questo comando:
cat privkey.pem
:
-----BEGIN ENCRYPTED PRIVATE KEY-----
MIIFDjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIo1rE/z2PcrMCAggA
MBQGCCqGSIb3DQMHBAiDRNWrVvL7CQSCBMgkkOxb7ovb6T0xPjl40T64qNeMhYav
lqXpBLdZZGAnu6Y+Cl4yhr9/Aqnt6wWWf8Dlbdd/cRxenZ1Y+bAhiXWTVNxqMX9I
Qjk2pIpjSkIVSM3tt47XGX+7qIEQxGBaM9yq8U8FjkvkvlVFvJhhbMZQLB0wxheC
+P/YA2co74u51DZr2YKf8Oo/ZVpQ3ivv2Nv7HCDMsymQKylFtOWWup20jAUMrcVx
VAu+Nn95XYa9yBXGMxMw/52p9/FZMcgtCG5EdITP/xerVh0Qrl+aZWYs9n6yl25K
pQ7eboewA8hDHg0CrOsImm4KquB1bhHQTL8Ns5xvq7c43PEUi6CTu4/5bNlkgg71
/y9zzJH1K3xvqS2rb7tjOYLyDMvJkHguNL0WG/SxetArppdrA3wwuBeSogCEFbKE
dXoQwTPf56uMbVXjHIHCJKnn6oRNDBAUgYvd3ifsiZX0MF1Tll64iqLgUilAItoa
wASWsudJCb0HhXR73hmtPC+BQECtsXfRYmCg/ffKtZZIqXRplECWDQR8F0kcsvj1
rZQDffFKGiv9ftW6bS51a0xa1WGpIgtcNeLtz0JBGkZwN3ykQCGDkk2khBGFYxfu
Xkm2G6cuwVMDg8ekg0ie95Zj2nCjS2TtnpKFiX+kxjPmfgTFzdd9jdVyA3ZEpfC/
HZRwEfoaXDgiUP6nOBEB00VLXkjoTw7oFheP8LkX9yJkGokXeSstyl3YXyFvTbNs
vk1oa4qyTmTAaWWIpkYDFc/8p6wtQpYLqkz8eyKiNDsZIxpo5upyya1U3dEuX1Pu
XCoHDsR6t+OINW2CCtMh2VhG5FRMK0sRPDGfOof32/HbIRE/mJf+cyxdk12aXrbu
3kiKxM72LJiEmcP2Yzw9Wbgnen5zBZlLEcLopHqVdWZS1QNKvpGHl+drUAGmGGIZ
fB4evfS2YLmZrhP01nAqNwRHntJXlyoOWKsJz9F6RAA87tGRhAuKX9R7j6vMFrU8
83RL3JAqnt1AvSOSkd8NMJb041aSKvlRcGC1Gzw/kebzQTy5m4PZDiNrgnRGtucO
KPwyMA43HnObY4apD5H8VQrgREp+o1Rnjnvx3+l8o7SuGXf7CqMT6B2kpYgECSP5
9f3YNLkxGZFAoD5G4QPQRHLJmoFsiZ25bYVjleCHIR05WkktV6ps9Hk5qyQocmaU
Agf4opOJfV3KoL3czcnNLdXzG+O6q1n9W+9OCI7ku+Z/v+K8sQkUaH0qjc8w3tV/
Bjq+6kvyk70V9rftbu0yu2gBXqjTdtCE4jhM4pdAGpC2iQr0pKGMRYaSDqNbXtZX
bRreZTxxk8mI+mEjpIyA8jrm0E6jdBd2M0SLI4VCUdkINyk1zRZp+A2zZMUhMp5V
jC2syFs2Od19Ax7WVj+bkDsRSF0TKdpp8/hC9zEzz+oztrhHOG3+sfJJznjm4ZtW
Wm2Wwa5PVQxNVIXT5kX6/HNBdgRdc09bYAo5KPXgeNNgd7Jpz1GinEIR4y8mZa8s
DXkBlXfew+jzHA7eqRSWdwVHvlj9an6snSuBeKjNYKew9zRTX1ANFpq4Pa9mV+LI
/ckYfEoHD3wLWohzNs42dNvtj4DWeqlIHiu5dEpLMjxKeMvqMFxP/SZufE3VCMN+
sMY=
-----END ENCRYPTED PRIVATE KEY-----
Se si genera una chiave privata RSA con:
openssl genrsa -out privkey2.pem 2048
quindi non è crittografato per impostazione predefinita. Se aggiungi -aes256
(o qualsiasi altra cosa supportata) l'output sarà:
cat privkey2.pem
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: AES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+ZAnMn5nR0ghS8DS42A8nXfClfKiRO277e7sf/RWq/ktBrjS65bDvhiz7nl
QuF+BJiAZL6Evfj5IQA4V7xpbdt/izjIjQAeOT8UejVs9XJGu90sLlDXlnBLxowV
K1gqU5kj1Uqt3kzU7omokNGM8LRaiPj6brWt3zOzWiyQb0RUGHbm7tEVQXcoAa8h
SEtZRPmUgyIiLIA23uASVUcV7qL4TYlO4mL1KeaC/8ZAEjFAECQSNu6l80lChunE
jbftFHV9vPZkyiM3Sfjv49PNoJ2v7NdBUTZr+ajiDIi1AW7lXmrcIBHo15a4+pHU
PvMvJXO5cXwexzbuBADicXcq1PooZogs6mFlHuDDBb9avnZhVTk+yq+Ii8OTvDVi
ZdFxQhxB6FbV72xdqRXvaqwujcvQRWVmUM4jUR+WQR1ZcW1jl1UjJKu+CcfmbjPG
RlK10HH4CId3VqHsYUhf2JuzLcRwR4dng5Z/Ye3c0hip0QRBWyp/HzVh66ItPtB9
A2UIk2IBvMI9YPciXTWSjcZogemRH1GL0ZiE0Lgma9iPttdWSofL0yJ09lUW3bR6
-----END RSA PRIVATE KEY-----
Non ho trovato alcun comando per ottenere il tipo di crittografia.
La passphrase per entrambi sono: pass
.