Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python generate public private key pair

from cryptography.hazmat.primitives import serialization as crypto_serialization
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.hazmat.backends import default_backend as crypto_default_backend

key = rsa.generate_private_key(
    backend=crypto_default_backend(),
    public_exponent=65537,
    key_size=2048
)

private_key = key.private_bytes(
    crypto_serialization.Encoding.PEM,
    crypto_serialization.PrivateFormat.PKCS8,
    crypto_serialization.NoEncryption()
)

public_key = key.public_key().public_bytes(
    crypto_serialization.Encoding.OpenSSH,
    crypto_serialization.PublicFormat.OpenSSH
)
Comment

PREVIOUS NEXT
Code Example
Python :: python recursively print directory 
Python :: copy list python 
Python :: how to convert binary to text in python 
Python :: convert all images in folder to jpg python 
Python :: python webdriver disable logs 
Python :: python break for loop 
Python :: how to do swapping in python without 
Python :: random picker python 
Python :: types of system 
Python :: version python 
Python :: Select rows without NaN in specific column 
Python :: django static files 
Python :: what does .shape do in python 
Python :: rmse python 
Python :: import numpy financial python 
Python :: find the index of a character in a string python 
Python :: pdf to csv conversion 
Python :: python check tuple length 
Python :: pandas to dictionary 
Python :: how to make a resizable python tkinter window have a limit 
Python :: 3d array numpy 
Python :: how to get the duration of audio python 
Python :: pytorch unsqueeze 
Python :: get the current date and time in python 
Python :: uninstall python linux 
Python :: how to create dictionary between two columns in python 
Python :: create requirement .txt 
Python :: how to scrape multiple pages using selenium in python 
Python :: how to create a python server 
Python :: python plot groupby colors 
ADD CONTENT
Topic
Content
Source link
Name
6+1 =