Why when converting string to byte[] using Convert.FromBase64String(...) i can't put two same characters?
For example I have
class User
{
public string Login { get; set; }
public byte[] Password { get; set; }
}
class Program
{
static void Main(string[] args)
{
var login = Console.ReadLine();
var password = Console.ReadLine();
var bytePass = Convert.FromBase64String(password);
var user = new User() { Login = login, Password = bytePass };
}
}
When I put as password string with two same characters ("testt" for example) it throw exception
System.FormatException: „The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.”
What I should to do if I want convert string which multiple same characters to byte[]? Is it even possible?