Giter Site home page Giter Site logo

tearitco / cypherbasic Goto Github PK

View Code? Open in Web Editor NEW

This project forked from silizium/cypherbasic

0.0 0.0 0.0 126 KB

C64 6502 assembly-language basic extension for the Commodore 64 with a lot of useful functions for classic cryptography

License: MIT License

Assembly 98.74% Makefile 1.26%

cypherbasic's Introduction

CYPHERBASIC 64

Cypherbasic Image

loading & compiling

LOAD "cypherbasic",8,1:new:sys9*4096
compile: make

with cc65 compiler/assembler package

description

Just a tiny, little fun-project of mine. I was asking the question: “why does anybody use the C=64 as a cyphering machine, crypto-device?” And I started to build some very simple and basic crypto library functions in 6502.

After a day or so I discovered that most peole are not talking 6502 but have no problems with BASIC, so why not call the functions from a small basic extenstion I asked?

The result is this project, still unter development. Its consuming some time to code and I ask myself if anybody is interested in such stuff? Cause if nobody uses this I really could put my time in other projects. In a german C=64 forum the echo was friendly but not very broad. So I just ask here.

There are yet some useful functions in this project, to name some:

ROTATE$( String, Rotation) 

Rotates a String around like for the cesar chiffre.

Example:

?ROTATE$(“ABCDEFG”,2) 
FGABCDE 

SUBST$( Textstring, Alphabetstring, Codestring) 

Substitutes the chars in the Text with the substitution table from alphabet and codestring just like the rotor of a rotormachine like the enigma.

Example:

TE$=“ATTACKATDAWN” 
AL$=“ABCDEFGHIJKLMNOPQRSTUVWXYZ” 
CO$=ROTATE$(AL$,13) : REM CESAR CHIFFRE 
?SUBST$(TE$, AL$, CO$) 
NGGNPXNGQNJA 


TRANS$( Textstring, Sourcepositionstring, Destpositionstring) 

Makes transpositions, means changes the position of the characters in a string like its defined in Source and Destination. All three strings have to have the same length of cause and all codes in source have to be in dest also. Else there will result errors.

Example:

TE$=“ATEST” 
SO$=“12345” 
DE$=“45213” 
?TRANS$(TE$, SO$, DE$) 
STTAE 


FILTER$( String, Filterbyte) 

Can filter the input from in filterbyte specified attributes, defined like this:

  • [0] lower char
  • [1] numbers
  • [2] space and punctation
  • [3] upper chars
  • [4] strip doubles
  • [5–7] clears bit 5,6,7

Examples:

A$=“ABCDEFGHIJKLMNOPQRSTUVWXYZ” 
PA$=“PASSWORT” 
?FILTER$(PA$+A$,$11) 
PASWORTBCDEFGHIJKLMNQUVWXYZ 

?filter$(“abc123 def”, $01) 
abcdef 
?filter$(“abc123 DEF”, %00001001) 
abcDEF 
?filter$(“abc123 DEF”, %10000001) :rem $81 = 129 
abcdef 
a$=“The attack will start at noon” 
?filter$(a$, $81) 
theattackwillstartatnoon 


BLOCK Size (, Perline) 

Prints out all output ordered in blocks like its common in cryptography.

Example:

BLOCK 5 
?“ATTACKATDAWNPREPAREFORHEAVYARTILLERY” 
ATTAC ATDAW NPREP AREFO HEAVY 
ARTIL LERY 

Same with BLOCK 5,1 

ATTAC 
ATDAW 
NPREP 
AREFO 
HEAVY 
ARTIL 
LERY 

DIRECTORY

Shows the directory of files, you can abbreviate with diR

There are some other commands that have seen their implementation yet like OLD, REPEAT..UNTIL, like reading hexadecimal or binary numbers. And some commands and functions that lure to be coded like a RENUM, some cryptoanalysis functions, WHILE..WEND, DO..DONE construction, IF..THEN..ELSE..ENDIF and so on.

But before I throw away much time, I am first looking for any feedback. Latest version can be downloaded from here (search end of thread for latest version) I still did not put it on my website, cause its just in development.

I played around with some cryptomachines and had no problems with implementing basic, classic machines, an enigma should be a easy going with this, but I did not do it yet. I won’t take you away the fun

Take a look at the *.lst files to see the examples in ASCII. Otherwise load the *.prg with your C64 or an emulator.

Have fun! Provide feedback, if you had.

Hanno

versions

0.10: update for ca65 V2.16 - Git 947b09ad, assembling again

0.9: initial upload

cypherbasic's People

Contributors

silizium avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.