xork is pronounced xork.

In response to an inquiry on the full-disclosure mailing list, wherein somebody asked for a quick-and-dirty way of encrypting things from the command line, I have written xork. It is puny and weak, but it amused me.

I welcome any suggestions, as I am not l33t.

Update: Yes, I’m well aware that this is the cryptographic equivalent of the locks that tourists put on their luggage. Thank you.

5 Comments

  1. Posted October 26, 2004 at 1:03 am | Permalink

    %
    % a matlab port of xork code
    %

    % input file names
    f1=input(‘Filename to encrypt/decrypt: ‘,’s’);
    f2=input(‘Filename to use as cypher: ‘,’s’);
    f3=input(‘Output file name: ‘,’s’);

    % read in files
    fid1=fopen(f1);
    d1=fread(fid1,’*char’);
    fclose(fid1);

    fid2=fopen(f2);
    d2=fread(fid2,’*char’);
    fclose(fid2);

    %xor files with wrap around
    c=[];
    for j = 1: length(d1)
    c(end+1)=double(bitxor(uint8(d1(j)),uint8(d2(mod(j-1,length(d2))+1))));
    end

    %write output file
    fid3=fopen(f3,’wb’);
    d3=fwrite(fid3,char(c),’uchar’);
    fclose(fid3);

    Weeeeeeee :)

  2. Mike Hoye
    Posted October 27, 2004 at 12:10 am | Permalink

    The following was also written in Matlab:

    Warning: fsockopen(): unable to connect to 69.70.209.171:8000 in /var/www/quantumcat.off.net/html/index.php on line 78
    !!! ERROR !!! — Sorry, can’t talk to the quantumcat server I wrote… I’m sorry some stuff won’t work.. so check back later… when this message is gone.. it’s working again! – sean.

    Matlab: RAD tools for the flagrant overuse of exclamation points and ellipses.

  3. DQ
    Posted October 27, 2004 at 12:16 am | Permalink

    Shouldn’t the fgetc in following snippet from xork.c be “xagchar=fgetc(….)”

    > if (xagchar == EOF) {
    > rewind(xor_against_file);
    > fgetc(xor_against_file);
    > }

  4. Mike Hoye
    Posted October 27, 2004 at 12:31 am | Permalink

    Yes. Yes it should.

  5. Mike Hoye
    Posted October 27, 2004 at 12:50 am | Permalink

    Fixed. Added key-weakness metric too, just for kicks.