Duckbits flips bit according to the sequence calculated by the key user entered.
File ducking works essentially by manipulating the bits in the given file. There is no :randomness: in how the algorithm manipulate the bits, it is well defined in the key used to duck them.
The ducking key is converted into binary, for example "foobar" will become "011001100110111101101111011000100110000101110010"
This combination will be used to feed the flipping mechanism that flips the bits in the data file at the interval defined by the sequence of the ducking key.
Example.
[011001100110111101101111011] Ducking-Key is XOR with the data continuously
Data: 0110100001100101011011000110|1100 at any location the result gives a one, the data bit is flipped
011011110010000..
[011001100110111101..] Until the data file is exhausted
1100011011110010000
Because of this, the algorithm is two-way if you have the ducking key.
However, because brute force can be used to flip 2^n bits where n is the total length of the file decryption by brute force may produce a possible solution. To address this,
Duckbits algorithm arbitarily adds a "Secret Block" (SB) of random bit vector size of (K^2 + 1), where K is the integer Sum of the 8 bits preceeding the SB insertion point, J.
The insertion point J is dependent on the Ducking Key bit ordering.
It is possible for a file to be ducked multiple times by multiple keys. To unduck the file, you must unduck the ducked file in the exact reverse order with its respective key(s).
make duckbits
./duckbits <file_to_be_ducked>
and you can also do a reverse ducking
./duckbits <ducked_file>
Disclaimer: This is for experimental purpose and is by no mean a secure way of encrypting your documents. Use it at your own risk, or fork it :)