WASM is often used alongside Javascript, but there’s actually nothing which inherently requires it.
There is no established way to load WASM in your browser without JavaScript code that does it for you, so there actually is.
Can you explain why you feel that locally running Javascript is more insecure than using, say, locally running Python code, for encryption?
A web browser is the most vulnerable software on your computer.
To stick with the one example I brought, namely GnuPG encrypted e-mails: Running GnuPG locally on my machine to encrypt/decrypt/verify an e-mail before pasting the result into (e.g.) my e-mail client is reasonably secure. GnuPG has been audited thoroughly enough, so it's (relatively) safe to assume that no bad actor will read and/or modify the e-mail on the way. I am not aware of any JavaScript alternative with a similar security record.
I think we're derailing a bit though. My original comment was:
You can’t do that (= secure encryption) in a browser.
Locally and in a browser are, in real life, mostly different things and I assume you know that. GnuPG in webmail software without having used it locally first, which is what I was hinting at, just isn't secure.
edit: Bed time, might continue this tomorrow after work if I'll find some Lemmy time... good night for now!