Posts

Find Hive Users Memo Key and Send Encrypted Message

1 comments·0 reblogs
completenoobs
44
·
0 views
·
min-read

=Intro=

Learning about hive by tinkering

  • Find The Memo Public Key from username
  • Encrypt a Message so only the private key holder of that public key can decrypt

==Creating Container==

  • Creating a Container so we know reproducable (depends installed ... etc)

  • create container
    lxc launch ubuntu:24.04 keys

  • Login to container
    lxc exec keys bash

  • switch to user ubuntu
    su - ubuntu

==Update Container and Install Dependencies==

  • Update package lists
    sudo apt update && sudo apt upgrade -y

  • Install essential packages
    sudo apt install -y python3 python3-pip python3-venv git build-essential

  • Install development libraries needed for compilation
    sudo apt install -y libssl-dev libffi-dev python3-dev

  • Verify Python installation
    python3 --version
    pip3 --version

==Create Virtual Environment (Recommended) ==

  • Create a virtual environment
    python3 -m venv hive_beem_env

  • Activate the virtual environment
    source hive_beem_env/bin/activate

  • Verify you're in the virtual environment (should show the path)

==Install Beem==

  • NOTE: Beem is installed in Virtual Environment to avoid error: externally-managed-environment

  • Install beem from PyPI
    pip install beem

  • Verify installation
    python -c "import beem; print(beem.version)"

=Find a Hive Users Public Keys=

  • Create Script
    $EDITOR find-user-keys.py
  • To use script
    python3 find-user-keys.py --username completenoobs
  • OutPut:
  • Will also create a text file container user keys in same directory script run:

=Encrypting and Decrypting=

  • Install Missing Depends
    pip install cryptography

  • Create Script
    $EDITOR crypt.py

  • OutPut:

==Example Use ==

  • In this example 2 key pairs where created, to send and receive

== Example of Script use 2 ==

  • Below is some test keys generated for this demo
  • This time it did not give same public key from signing private key - but still worked.

=== Encryption and Decryption Example 2 ===

Posted Using INLEO