I am building a cryptocurrency wallet online where everything is stored in the browser (No servers).
At this moment I am storing all private keys encrypted using AES-128-CTR I've chosen this method because is the standard for Ethereum keystore file format.
Is this algorithm secure to encrypt any other private key such Bitcoin (which is not hexadecimal)?
Would it be also secure to encrypt 12 words mnemonic or any other string?
Here is my implementation: https://github.com/elevenyellow/coinfy/blob/master/miscellaneous/experiments/aes-ctr-128.js
Edit: @SAI Peregrinus says on his response that my implementation is completely insecure which make me think, is the same for myetherwallet.com? Because my code is just a refactor of this: https://github.com/kvhnuke/etherwallet/blob/44074daeef3f98ca15410158b5a5403ac734a08a/app/scripts/myetherwallet.js#L196
Edit2:
Studiying the geth (Ethereum go) client implementation I don't see any difference except for the parameter kdf.n
where their value is 262144
and mine is 1024
: