Skip to content

Repository files navigation

FlipComp

A Silly Cryptographic Encoding Algorithm

Concepts Involved

  • String Reversal

  • 2's Complement

    privatechar[] flipComp(Stringst) {
    char[] src = st.toCharArray();
    intl = st.length(), n = l / 2, x = l - 1;
    intb = 0x80;
    for (inti = 0; i < n; i++) {
    charc = (char) flipNibble((~src[i] + 1) ^ b);
    src[i] = (char) flipNibble((~src[x] + 1) ^ b);
    src[x] = c;
    x--;
    }
    returnsrc;
    }
  • Flip Nibble (4-bits)

    privateintflipNibble(intn) {
    return (((n & 15) << 4) | ((n >> 4) & 15));
    }

About

A Silly Cryptographic Encoding Algorithm

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages