To obfuscate data I made up this method on the spot without planning since the goal wasn't real encryption.
At first I though this cannot be real encryption but after revisiting the code and reading on block symmetric encryption, and including R in the method, it seems that it is( looks like a stream cypher, OFB specifically ).
The method is the following( pseudo code ):
-Hash function parameters, secret key, hash and array elements all have the same size in bits.
-Size is at least 128 bits for this example.
-Using a cryptographic random generator.
H - cryptographic hash function
K - secret key, randomly generated
A - array of plaintext
L - array length
R - randomly generated, is not encrypted and is stored with the resulting encrypted data
keyhash = H(K)
hash = R
for( i , i < L , i++ )
{
hash = H( hash ^ keyhash )
A[i] ^= hash
}
Could this be called encryption or it has some fundamental flaws that would break it immediately?
^
is XOR in Java as well, but above you've only defined the plaintext. Now it's also the ciphertext after the operation. $\endgroup$