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

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

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 bulletin boards, or in newspapers, in order to reach a wide audience. Some examples of how public notices have been used in history include:

Original Post Hash: b94bb4a558d439eaa1de334e579d693636406116ce19f75bd9f4138dab2a2c7d

  • Announcing events or meetings: Public notices have been used to announce the dates and times of public meetings, festivals, or other events.
  • Issuing warnings or alerts: Public notices have been used to warn the public about potential dangers or emergencies, such as storms, fires, or other disasters.
  • Proclaiming laws or regulations: Governments have often used public notices to announce new laws or regulations, or to remind the public of existing rules and requirements.
  • Providing information about lost or found items: Public notices have been used to help people locate lost items or to claim found items.
  • Advertising goods or services: Businesses have used public notices to advertise their products or services, or to announce sales or special deals.

In modern times, public notices are still used for many of the same purposes, but they are often published online or in other digital formats in addition to being posted in public places or printed in newspapers.

SHA256 Hash: ee444eae465cb6c60411d7535eaf7625b92375eec73eda15d8151dd339cbe493

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

Leave a Reply

Your email address will not be published. Required fields are marked *