Skip to content

Generate memorable EFF Dice-Generated Passphrases in Commodore BASIC.

License

Notifications You must be signed in to change notification settings

elliotwutingfeng/CommodoreEFFPassphrase

Commodore EFF Passphrase

Commodore BASIC

GitHub license

Generate memorable EFF Dice-Generated Passphrases in Commodore BASIC.

Works on the Commodore 64, Creative Micro Designs SuperCPU64, Commodore 128, Commodore CBM-II, Commodore PET, Commodore Plus/4, Commodore VIC-20, and Commander X16.

Written for the VICE Emulator and Commander X16 Emulator.

Uses the EFF short wordlist v2.

demo

Supported devices

Device (emulator command(s)) Emulator BASIC Version Program File
Commodore 64 (x64 or x64sc or x64dtv) VICE V2.0 bin/c64.prg
Creative Micro Designs SuperCPU64 (xscpu64) VICE V2.0 bin/c64.prg
Commodore 128 (x128) VICE V7.0 bin/c128.prg
Commodore CBM-II P500 (xcbm5x0) VICE V4.0 bin/cbm5x0.prg
Commodore CBM-II (xcbm2) VICE V4.0 bin/cbm2_pet.prg
Commodore PET (xpet) VICE V4.0 bin/cbm2_pet.prg
Commodore Plus/4 (xplus4) VICE V3.5 bin/plus4.prg
Commodore VIC-20 (xvic) VICE V2.0 bin/vic20.prg
Commander X16 (x16emu) Commander X16 Emulator V2.0 bin/x16.prg

Warning

  • This project is a recreational proof-of-concept to demonstrate how high-entropy passphrases may be generated in Commodore BASIC.
  • Random number generators used by Commodore home computers are not cryptographically secure.
  • If you need dice-generated passphrases for critical applications, follow the directions provided by the Electronic Frontier Foundation.

Requirements

Usage

VICE Emulator

Additional setup for VIC-20 (xvic)

Skip this step if you are not using the VIC-20 (xvic).

Commodore VIC-20 requires memory expansion before the program can be loaded into the machine.

In VICE, go to

  • PreferencesSettings
  • MachineModel
  • Memory expansionsCommon configurationsAll (block0/1/2/3/5)

Then perform a hard reset

  • FileResetHard reset

Run in VICE Emulator

If you are using the VIC-20 (xvic), ensure that you have completed the aforementioned additional setup before proceeding.

In VICE, go to

  • FileSmart attach ...
  • Choose the appropriate .prg program file from this repository. See Supported Devices.
  • Autostart
  • Enter number of words to generate (3-20)

Commander X16 Emulator

In the terminal, run the following

Linux/macOS

x16emu -run -prg bin/x16.prg

Windows

x16emu.exe -run -prg bin\x16.prg

Development

Generate BASIC code and compile to PRG format

make build

Acknowledgements

GOTO with calculated expressions hack for Commodore 64 by Frithjof Dau, published on DATA WELT magazine issue 4/85.

Useful links