from cryptography.fernet import Fernet def encrypt_message(public_key, message): # Get the public key in bytes public_key_bytes = bytes.fromhex(public_key) # Generate a symmetric key symmetric_key = Fernet.generate_key() # Encrypt the message using the symmetric key f = Fernet(symmetric_key) encrypted_message = f.encrypt(message.encode()) # Encrypt the symmetric key using the public key rsa_key = RSA.import_key(public_key_bytes) cipher_rsa = PKCS1_OAEP.new(rsa_key) encrypted_key = cipher_rsa.encrypt(symmetric_key) return encrypted_key, encrypted_message

import ecdsa # Generate a private key private_key = ecdsa.SigningKey.generate(curve=ecdsa.SECP256k1) # Get the public key public_key = private_key.get_verifying_key() # Encode the keys to hexadecimal format private_key_hex = private_key.to_string().hex() public_key_hex = public_key.to_string().hex() print(f'Private key: {private_key_hex}') print(f'Public key: {public_key_hex}') from cryptography.fernet import Fernet def encrypt_message(public_key, message): # Get the public key in bytes public_key_bytes = bytes.fromhex(public_key) # Generate a symmetric key symmetric_key = Fernet.generate_key() # Encrypt the message using the symmetric key f = Fernet(symmetric_key) encrypted_message = f.encrypt(message.encode()) # Encrypt the symmetric key using the public key rsa_key = RSA.import_key(public_key_bytes) cipher_rsa = PKCS1_OAEP.new(rsa_key) encrypted_key = cipher_rsa.encrypt(symmetric_key) return encrypted_key, encrypted_message from cryptography.fernet import Fernet def encrypt_message(public_key, message): # Get the public key in bytes public_key_bytes = bytes.fromhex(public_key) # Generate a symmetric key symmetric_key = Fernet.generate_key() # Encrypt the message using the symmetric key f = Fernet(symmetric_key) encrypted_message = f.encrypt(message.encode()) # Encrypt the symmetric key using the public key rsa_key = RSA.import_key(public_key_bytes) cipher_rsa = PKCS1_OAEP.new(rsa_key) encrypted_key = cipher_rsa.encrypt(symmetric_key) return encrypted_key, encrypted_message
Skip to content
PublicNotice.Crypto "Say What You Want to Say
Uncategorized

I asked, “Open Ai” a question, as to how I could use, “Maria DB”, as a transaction, on a blockchain and how would I do it; and here was the, Answer:

No Comments

How can I use MariaDB as a database for a Blockchain, create a blog for my “MariaDB”: as a blockchain to be published on the blockchain in the future; ai? MariaDB is…

publicnotice.crypto@gmail.com
by publicnotice.crypto@gmail.com
January 4, 2023January 10, 2023
Uncategorized

“Mysql” is a blockchain?

No Comments

Mysql is data base that records, inputs as a data base on your own personal Blockchain? Did you hear me? The QR Code below address is that fact!’ The words that followe…

publicnotice.crypto@gmail.com
by publicnotice.crypto@gmail.com
January 4, 2023January 9, 2023
Uncategorized

wowsers

No Comments

SHA256 Hash: 1e903d71edff085db083cd9e8e6a3aacd4b65963825d29d8065719ea7eb7fb1c

publicnotice.crypto@gmail.com
by publicnotice.crypto@gmail.com
January 1, 2023January 5, 2023
Uncategorized

Can Government Hack your Bitcoin?

No Comments

It is theoretically possible for a government or other entity to attempt to gain control of the Bitcoin network through the use of powerful computers, also known as “mining rigs.” This could…

publicnotice.crypto@gmail.com
by publicnotice.crypto@gmail.com
December 28, 2022January 4, 2023
Uncategorized

How were Public Notices used throughout history? And can they be used on the Blockchain?

One Comment

Public notices have a long history of being used to communicate important information to the public. In the past, public notices were often posted in public places such as town squares, on…

publicnotice.crypto@gmail.com
by publicnotice.crypto@gmail.com
December 28, 2022January 4, 2023

Posts navigation

Older posts
Newer posts

Powered by WordPress | Theme Blogbaster by DinevThemes