You ask the Replace method to change an empty string (first parameter) with a plus sign (second parameter). That doesn't make sense, and Replace complains about it.
I think you want to do the reverse
byte[] todecode_byte = Convert.FromBase64String(encryptpwd.Replace("+",""));
Part of this, I'm not sure what the result will be when you change something into the input string and apply FromBase64String to the result. Well, it really depends on what was originally in the string, but for sure (if encryptpwd is really a Base64 string), there are no spaces to replace.
Keep in mind that you cannot pass a normal string to Convert.FromBase64String, you need a string that is the base of the 64 string
What is base line 64
for example
string pwd = "786";
The last word. Someone (@Slacks) already tells you that the base64 string is not an encryption technology, and you should not use it to encrypt passwords (they are not encrypted at all)
Steve
source share