Project detail

Project detail

Project detail

Quantum Safe Crytography

Cryptography Protocol made possible by Quatum Error Correction (QEC) secured by Ethereum's network

Blockchain

3 months

Open Source

A Cryptography Protocol made possible by Quantum Error Correction (QEC) secured by Ethereum's network refers to an innovative cryptographic system that leverages the advanced features of quantum computing for enhanced security while being anchored on the robust and decentralized infrastructure of the Ethereum blockchain. Here’s an expansion of the concept:

Explanation:

  1. Quantum Error Correction (QEC):
    • Definition: Quantum Error Correction (QEC) is a method used in quantum computing to detect and correct errors that occur due to qubit decoherence, noise, and operational faults. QEC ensures that quantum information can be preserved accurately, making quantum computations reliable over extended periods.

    • Role in Cryptography: In cryptographic protocols, QEC is vital for maintaining the integrity of quantum keys or data. This can involve protecting quantum states used in quantum key distribution (QKD) or other quantum-secured communication systems.

  2. Cryptography Protocol:
    • Quantum-Enhanced Security: The protocol could involve quantum key distribution (e.g., BB84 protocol), where QEC ensures that any eavesdropping attempts by malicious actors are detectable.

    • Error Rectification: The QEC aspect rectifies errors within the quantum states during transmission, maintaining the security of the cryptographic operations.

  3. Secured by Ethereum's Network:
    • Ethereum Blockchain: The protocol is integrated with Ethereum, leveraging its smart contract capabilities and decentralized nature to enhance transparency and trust.

    • Decentralization: By using Ethereum’s blockchain, the protocol benefits from a global network that secures and verifies cryptographic transactions and smart contracts.

    • Trustless Environment: The integration ensures that the cryptographic protocol operates in a decentralized, trustless environment, which mitigates risks of central authority compromise.

Application and Benefits:

  • Quantum-Resistant Ledger: The Ethereum network secures transactions related to quantum cryptographic operations, acting as an immutable ledger that can record key exchanges and cryptographic proofs.

  • Enhanced Security: QEC ensures that quantum keys and cryptographic information remain error-free and robust against both classical and quantum attacks.

  • Trust and Transparency: By anchoring the cryptographic protocol to the Ethereum network, parties can verify interactions and exchanges in a transparent manner, benefiting from Ethereum’s established infrastructure.

Potential Use Cases:

  • Quantum Key Distribution (QKD) anchored by Ethereum for secure communications.

  • Smart Contracts that incorporate quantum cryptographic operations, making them tamper-proof and secure against both classical and quantum cyber threats.

  • Data Integrity protocols that rely on QEC and Ethereum to ensure that stored or transmitted data remains unaltered and verifiable.

In essence, this cryptographic protocol harnesses Quantum Error Correction (QEC) for enhanced security and is backed by Ethereum’s network for a decentralized, tamper-proof, and scalable solution to secure future-proof cryptographic practices.

Source Code:

#!/bin/bash
################################################################################
##          Scripted by Pranesh L                                             ##
##          Version 1.4.1                                                     ##
##          All dependencies defined.                                         ##
##          SCOPE: QEC Communication Between Endpoints in Private Network     ##
##          TODO: Insert Infura API Key or use private Ethereum node          ##
################################################################################
function getXOR() {
    message_bits=($(echo -n "$1" | xxd -b -c1 | awk '{print $2}'))
    key_bits=($(echo -n "$2" | xxd -b -c1 | awk '{print $2}'))
    result=""
    for ((i=0; i<${#message_bits[@]}; i++)); do
        message_bit=${message_bits[$i]}
        key_bit=${key_bits[$i % ${#key_bits[@]}]}  # Use modulo to wrap around key if it's shorter
        xor_bit=$((message_bit ^ key_bit))
        result+=$xor_bit
    done
    echo $result
}
function convertHexToBinary() {
    if [ $# -eq 0 ]
    then
        echo "Argument(s) not supplied "
    else
        while [ $# -ne 0 ]
        do
            DecNum=`printf "%d" $1`
            Binary=
            Number=$DecNum
            while [ $DecNum -ne 0 ]
            do
                Bit=$(expr $DecNum % 2)
                Binary=$Bit$Binary
                DecNum=$(expr $DecNum / 2)
            done
            echo $Binary
            shift
            unset Binary
        done
    fi
}
echo ""
echo -n "Enter Ethereum Transaction Hash:"
read txn
echo ""
echo -n "Connecting to Ethereum BlockChain Node"
for i in {1..5}
do
  echo -n "."
  sleep 1
done
echo ""
blockMeta=$(curl --no-progress-meter https://mainnet.infura.io/v3/<INSERT-API-KEY> \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc": "2.0", "method": "trace_transaction","params": ["'$txn'"],"id": 1}')
echo ""
echo "===========================================================================" 
echo From: $(echo $blockMeta | python3 -c "import sys, json; print(json.load(sys.stdin)['result'][0]['action']['from'])")
echo To: $(echo $blockMeta | python3 -c "import sys, json; print(json.load(sys.stdin)['result'][0]['action']['to'])")
echo Block number: $(echo $blockMeta | python3 -c "import sys, json; print(json.load(sys.stdin)['result'][0]['blockNumber'])")
echo "===========================================================================" 
etherValue=$(echo $blockMeta | python3 -c "import sys, json; print(json.load(sys.stdin)['result'][0]['action']['value'])")
if [ "$etherValue" == "0x0" ]; then
    echo "The Transaction does not transfer Ether (0x0 Ether)"
else
    echo "This Transaction has value of $etherValue Ether"
fi
echo The transactional gas price: $(echo $blockMeta | python3 -c "import sys, json; print(json.load(sys.stdin)['result'][0]['action']['gas'])") Ether
transactData=$(echo $blockMeta | python3 -c "import sys, json; print(json.load(sys.stdin)['result'][0]['action']['input'])")
if [ "$transactData" == "0x0" ] || [ "$transactData" == "0x" ]; then
    echo "The Transaction does not transfer any decentralized app data or NFT"
    echo "Terminating..."
    exit 0
else
    echo "This Transaction contains decentralized data"
fi
echo "===========================================================================" 
echo "Data:"
echo $transactData
echo "==========================================================================="
# Depricated due to the use of captcha
echo -n "Download receipt? [y][n]: "
read choiceR
#
if [ "$choiceR" == "y" ]; then
    curl https://blockexplorer.one/ethereum/mainnet/tx/$txn/receipt --output $txn.pdf
    echo "==========================================================================="
else
    echo "==========================================================================="
fi
echo "Generating Seed Stream from NFT or decentralized data:"
seedStreamHex=${transactData#0x}
seedStream=""
seedStreamArray=($(echo $seedStreamHex | sed -r 's/(....)/\1 /g'))
for i in "${seedStreamArray[@]}"
do
    binary=$(convertHexToBinary "0x"$i)
    echo -n $binary
    seedStream+=$binary
done
echo "" 
echo "===========================================================================" 
echo -n "Encrypt [e] or Decrypt data [d]? "
read choice
if [ "$choice" == "e" ]; then
    echo "Encrypt Text Message"
    echo -n "Enter Message: "
    read message
    binMessage=$(echo $message | perl -lpe '$_=unpack"B*"')
    encrypted=$(getXOR $binMessage $seedStream)
    echo Encrypted Stream:
    echo $encrypted
    echo ""
    echo "===========================================================================" 
    echo -n "Enter IP address of the recipient: "
    read IPadd
    echo $encrypted | nc $IPadd 1234
    echo ""
    echo "Message sent successfully"
    echo ""
elif [ "$choice" == "d" ]; then
    #my IP feature only works inside private network. Listening and Sending port configured to 1234
    myIP=$(ifconfig | grep 'inet 10' | awk '{print $2}')
    echo -n "Your IP is $myIP. "
    echo "Listening for inbound stream..."
    encrypted=""	
    while read enc
    do
        echo "Encrypted stream received"
        encrypted=$enc
    done < <

Mettalic shape background image

Contact

Let's Get in Touch

Let's secure the world, one threat at a time!

Mettalic shape background image

Contact

Let's Get in Touch

Let's secure the world, one threat at a time!

Mettalic shape background image

Contact

Let's Get in Touch

Let's secure the world, one threat at a time!