Question:

How secure is this c# encryption algorithm? (if a salt were used)?

by  |  earlier

0 LIKES UnLike

byte[] bytes = ASCIIEncoding.ASCII.GetBytes(textBox1.Te...

int hash = 1;

for (int n = 0; n < 10000; n++)

{

for (int i = 0; i < bytes.Length; i++)

{

if ((i * n) % 5 == 0)

{

hash *= bytes[i];

}

if ((i * n) % 5 == 1)

{

hash += bytes[i];

}

if ((i * n) % 5 == 2)

{

hash -= bytes[i];

}

if ((i * n) % 5 == 3)

{

hash += bytes[i];

}

if ((i * n) % 5 == 4)

{

hash *= bytes[i];

}

}

}

return hash

 Tags:

   Report

1 ANSWERS


  1. This is an empirical question that can be determined via a test that you are asking opinions about.

    First, I&#039;m not sure this is an encryption algorithm rather than a hashing algorithm.

    Secondly, as a hashing algorithm there are 2 properties of interest. 1) whether for a large number of possible inputs, keys are duplicated indicating hash collisions. This is also a good indication of how random the bits are assigned.

    2) whether the algorithm can be reversed. In security a one-way hash algorithm is better because it can&#039;t be reversed to find the key.

    Since if any byte is 0 the output of the last pass will be 0, my guess is it isn&#039;t a good algorithm for binary data.

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.
Unanswered Questions