Note_Tech

All technological notes.


Project maintained by simonangel-fong Hosted on GitHub Pages — Theme by mattgraham

Kubernetes Security: Fundamental

Back


TLS Cerfificates

对称加密


Asymmetric Encryption

  1. User access the webserver
  2. Webserver return the public key
    • 3rd-party also acquire the public key
  3. User encrypt and send the data with public key
    • 3rd-party can get the encripted data
  4. Webserver descript with private key.
    • 3rd-party not easy to descript the encrypted data without a private key.
  5. Webserver returns and encripted data with public key
    • 3rd-party not easy to descript the encrypted data without a private key.

Server Certificate

# CSR
openssl req -new -key my.key -out my.csr -subj "/C=US/ST=CA/O=MyOrg, Inc./CN=my.com"
# my.key my.csr

Client Cerficates


TLS example: SSH

# generate keys
ssh-keygen
# id_rsa: private key
# id_rsa.pub: public key

# copy public key
ssh-copy-id -i id_rsa.pub user@remote_server
# .ssh/authorized_keys

# access remote
ssh user@remote_server

TLS example: Openssl

# private key
openssl genrsa -out my.key 1024
# my.key

# public key
openssl rsa -in my.key -pubout > my.pem
# my.pem