Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symmetric key creation #53

Open
somoreingold opened this issue Jul 24, 2020 · 1 comment
Open

Symmetric key creation #53

somoreingold opened this issue Jul 24, 2020 · 1 comment

Comments

@somoreingold
Copy link

somoreingold commented Jul 24, 2020

Hi there,

Could you provide a bit more guidance on the required format of the symmetric key? The docs mention 32 characters long, then base64 encoded. I've tried generating it the way I'd expect via algorithms such as this:

System.Security.Cryptography.RandomNumberGenerator cryptoRandomDataGenerator = new System.Security.Cryptography.RNGCryptoServiceProvider();
byte[] buffer = new byte[32];
cryptoRandomDataGenerator.GetBytes(buffer);
string symmetricKey = Convert.ToBase64String(buffer);
Console.WriteLine(symmetricKey);

Which produces something that expectedly looks like a base64 encoded string, such as:
r3b/mk4itk/yH8195i5abxLHFV/fK3FJMNGJgfrnORU=

However, that type of string doesn't work (nor does it quite appear to have a similar format of the one in your sample--which looks more like a 32 character hex string?). The one in your sample works, but of course we wouldn't want to use that. Do you happen to have a snippet or some advice?

Thank you!

@grovolis
Copy link

Hey, you can either slightly edit the existing one in the example (it's impossible to guess and even if you do, it might not be enough to achieve anything) or create one from scratch from this link https://www.allkeysgenerator.com/Random/Security-Encryption-Key-Generator.aspx

Just click security level 128 bit and check HEX.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants