Skip to content

Encrypt or decrypt 12, 15, 18, 21 or 24 BIP39 codewords array (so-called "seed phrase") using exclusive OR (XOR)/Vernam cipher (a.k.a. One Time Pad).

Notifications You must be signed in to change notification settings

GregTonoski/BIP39-XOR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 

Repository files navigation

BIP39-XOR

Encrypt or decrypt 12, 15, 18, 21 or 24 BIP39 codewords array (so-called "seed phrase" or "recovery phrase") using exclusive OR (XOR)/Vernam cipher (a.k.a. One Time Pad). If not input by a user, an encryption key is automatically generated at random. Encryption with such a key preserves integrity of BIP-39 checksums of all keys (that's distinct while also compatible with SeedXOR implementation).

Usage: BIP39-XOR.sh [-s] [codewords...] [XOR] [codewords...]
       BIP39-XOR.sh [--auto-input]

EXAMPLES:

$ bash BIP39-XOR.sh time until select then return void float true false case catch depart

Encrypt into and output two complementary encryption keys encoded in BIP39 codewords.

$ bash BIP39-XOR.sh time until select then return void float true false case catch depart XOR age age age age age age age age age age age used

Use input keys to decrypt and output a key. Or, equivalently, encrypt an input key with another one and output two complementary encryption keys in BIP39 format.

$ bash BIP39-XOR.sh --auto-input

Generate input BIP-39 twelve codewords randomly and output two complementary encryption keys encoded in BIP39 codewords.

Screenshots

image

Launch on Windows

There are a few alternative methods to download and run the program on Windows, e.g.:

  1. Download and run the file: BIP39-XOR_setup.exe,
    BIP39-XOR on Windows - instruction video
    (BIP39-XOR on Windows - instructional video),
  2. open PowerShell application and copy-paste this line:
powershell Invoke-WebRequest -URI "https://github.com/GregTonoski/BIP39-XOR/releases/download/v.6.0.0/busybox.exe" -OutFile "$HOME\busybox.exe" ; Invoke-WebRequest -URI "https://raw.githubusercontent.com/GregTonoski/BIP39-XOR/main/BIP39-XOR.sh" -OutFile "$HOME\BIP39-XOR.sh" ; Start-Process -FilePath "$HOME\busybox.exe" -ArgumentList "bash","$HOME\BIP39-XOR.sh"

The next time BIP39-XOR.sh the shorter command (without downloading) will start the program: cd $HOME; .\busybox.exe bash BIP39-XOR.sh.

  1. The BIP39-XOR.sh will start by double-clicking the icon of the downloaded file or by a command line if any of the Git for Windows, MSYS2 or Cygwin is pre-installed (with the default file association settings).
  2. (recommended) Windows Subsytem for Linux if pre-installed then copy-paste this into the command prompt:
wsl.exe bash -c "cd ~ && wget -q https://raw.githubusercontent.com/GregTonoski/BIP39-XOR/main/BIP39-XOR.sh && bash BIP39-XOR.sh"

Launch on Linux, Unix, BSD, ChromeOS, Haiku and MacOS

Download and run from a terminal by either:

wget -q "https://raw.githubusercontent.com/GregTonoski/BIP39-XOR/main/BIP39-XOR.sh" && bash BIP39-XOR.sh

or

curl -fsSL "https://raw.githubusercontent.com/GregTonoski/BIP39-XOR/main/BIP39-XOR.sh" > BIP39-XOR.sh && bash ./BIP39-XOR.sh

Optionally make the file executable ( $ chmod +x BIP39-XOR.sh ) to run it in by the shorter ./BIP39-XOR.sh command subsequently.

Instructional video (how-to)

BIP39-XOR on MacOS - instructional video

MacOS: https://youtu.be/TT_Do5q8Yg8

BIP39-XOR on Linux - instructional video

Ubuntu Linux: https://youtu.be/D68SajCozKc

Launch on Android

Open the BIP39-XOR.sh file from a terminal app, e.g. Termux or SSH.

Launch on iOS

Open the BIP39-XOR.sh file from a terminal app, e.g. iSH Shell, a-Shell, LibTerm etc. or SSH or Binbag or research AltStore PAL, UTM SE: Retro PC emulator etc.

Launch on embedded and other systems

The program is compatible with Portable Operating System Interface (POSIX) shells so should run on various electronic devices. The launch methods should be similar to the ones described for other systems altough may differ in details and depend on a device.

About

Encrypt or decrypt 12, 15, 18, 21 or 24 BIP39 codewords array (so-called "seed phrase") using exclusive OR (XOR)/Vernam cipher (a.k.a. One Time Pad).

Topics

Resources

Stars

Watchers

Forks

Languages