I have made my own encrypt and decrypt algorithm, but if I call crypting class and encrypt data, it writes every time same salt to file, but if I start app again, the salt is different. Here are 2 application runs and its salts.
50|Mmlv"!QM17=@QwjT`11(f&}G14[bxNpN19"V+W_r`
41|Mmlv"!QM17=@QwjT`6(f&}G6[bxNpN14"V+W_r`15j.zVN6<|N-}
92|Mmlv"!QM
93|Mmlv"!QM
92|Mmlv"!QM91=@QwjT`93(f&}G
86|Mmlv"!QM88=@QwjT`
91|Mmlv"!QM93=@QwjT`
93|Mmlv"!QM
Second
50!qKR}H!;15#X:y/O`11{Q'b|1TL[PYecoj19?*V`E|L?-
41!qKR}H!;17#X:y/O`6{Q'b|6TL[PYecoj14?*V`E|L?-15M|;:Goln6&.E:yy=>
92!qKR}H!;
93!qKR}H!;
92!qKR}H!;91#X:y/O`93{Q'b|
87!qKR}H!;93#X:y/O`
86!qKR}H!;93#X:y/O`
87!qKR}H!;88#X:y/O`
And here's my encrypt code in C#
public string encryptString(string text)
{
Random rdn = new Random();
String[] textArray = new String[] { text };
string alphabet = "qzwxecrvtbynumiopalskdjfhgPMONIBUVYCTXRZEWQASLKDFJHG~!@#$%^&*()_+}{|\":><?`-=][\';/., 9632587410";
string hashedText = "";
for (int i = 0; i < text.Length; i++)
{
string salt = "";
int saltCount = rdn.Next(low_range, high_range);
for (int e = 0; e < saltCount; e++)
{
int alphabetSaltCount = rdn.Next(0, alphabet.Length - 11);
salt += alphabet[alphabetSaltCount];
}
hashedText += alphabet.IndexOf(text[i]).ToString() + salt;
}
return hashedText;
}