You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it safe to use the whole range of UTF-8 characters that are part of the byte in UTF-8 encoding?
I am referring to code points from U+0000 to U+007F at the following page https://en.wikipedia.org/wiki/UTF-8#Encoding and the characters related to that range (from U+0000 to U+007F) are at the following page https://www.utf8-chartable.de/.
I am asking this since I noticed not all the characters are used when generating keys with EncryptProvider.CreateAesKey(). The range being used in the source code is: char[] arrChar = new char[]{ 'a','b','d','c','e','f','g','h','i','j','k','l','m','n','p','r','q','s','t','u','v','w','z','y','x', '0','1','2','3','4','5','6','7','8','9', 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','Q','P','R','T','S','V','U','W','X','Y','Z' };
I tried using some UTF-8 codes outside of the range from code above but still in the range from U+0000 to U+007F and it worked fine.
Is it safe to use that kind of chars for encryption key?
From the following excerpt from the source code I can see that you are using Encoding.UTF8.GetBytes(...) to decode UTF chars to byte array so I guess it should be safe to use any of UTF-8 chars from the range U+0000 to U+007F for encryption key:
EncryptProvider.CreateAesKey() method only provides a convenient way to create a key, as long as the key meets the requirements, it can be used as a key.
Is it safe to use the whole range of UTF-8 characters that are part of the byte in UTF-8 encoding?
I am referring to code points from U+0000 to U+007F at the following page https://en.wikipedia.org/wiki/UTF-8#Encoding and the characters related to that range (from U+0000 to U+007F) are at the following page https://www.utf8-chartable.de/.
I am asking this since I noticed not all the characters are used when generating keys with
EncryptProvider.CreateAesKey()
. The range being used in the source code is:char[] arrChar = new char[]{ 'a','b','d','c','e','f','g','h','i','j','k','l','m','n','p','r','q','s','t','u','v','w','z','y','x', '0','1','2','3','4','5','6','7','8','9', 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','Q','P','R','T','S','V','U','W','X','Y','Z' };
I tried using some UTF-8 codes outside of the range from code above but still in the range from U+0000 to U+007F and it worked fine.
Is it safe to use that kind of chars for encryption key?
From the following excerpt from the source code I can see that you are using
Encoding.UTF8.GetBytes(...)
to decode UTF chars to byte array so I guess it should be safe to use any of UTF-8 chars from the range U+0000 to U+007F for encryption key:`public static byte[] AESDecrypt(byte[] data, string key, string vector)
{
Check.Argument.IsNotEmpty(data, nameof(data));
Thanks!
The text was updated successfully, but these errors were encountered: