Skip to content

Symmetric key creation #53

Open
Open
@somoreingold

Description

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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions