We are trying to integrate Subtlecrypto into our blazor webassembly app. It seems this is the only cryptography package that blazor wasm supports.
According to the official example, there is not a way to change/custom the secret key. If the secret is assigned at startup, the key is fixed and used across the application:
using Blazor.SubtleCrypto;
builder.Services.AddSubtleCrypto(opt =>
opt.Key = "ELE9xOyAyJHCsIPLMbbZHQ7pVy7WUlvZ60y5WkKDGMSw5xh5IM54kUPlycKmHF9VGtYUilglL8iePLwr"
);
Or one can use random key and iv that the application has no control.
In our app we hope to ask the user to enter a key, which is used to encrypt some data. A fixed key can work but it seems less secure.
Is there a way to achieve a custom secret key?