New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

xorencryption

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xorencryption

little Python library for encrypt and decrypt using XOR operation.

  • 0.1.6
  • PyPI
  • Socket score

Maintainers
1

XOR Encryption

Total alerts Language grade: Python

XOR Encryption is a little Python library for encrypt and decrypt string with key. This library is for those of you who are learning encryption using the XOR method.

How it Works

The library uses a simple encryption algorithm that converts plain text and keys to binary form and then XORs them both to generate cipher text. Here's the mathematical notation:

XOR encryption notation

Because performing XOR operations with the same value twice in a row yields the original value, the following is the mathematical notation for decryption:

XOR decryption notation

Note:

  • P = Plain text
  • K = Key
  • C = Cipher text

How to Use

Example code:

from xorencryption import XOREncryption

plain = "this is your plain text"
key = "boom"
enc = XOREncryption()

enc.set_plaintext(plaintext=plain)
enc.set_key(key=key)

print(enc.encrypt())  # return cipher text
print(enc.decrypt())  # return decrypted text

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc