# Is my AES-128-CTR implementation secure enough to encrypt private keys and mnemonic seed? [closed]

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:

https://github.com/ethereum/go-ethereum/blob/bedf6f40aff0dd14bfab533a37c329ddc9a4bdd5/accounts/keystore/keystore_passphrase.go#L118

## closed as off-topic by e-sushiJan 25 '18 at 6:21

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

• As noted in the “put on hold” reason: requests for reviewing full cryptographic designs (and sourcecode) are off-topic. – e-sushi Jan 25 '18 at 14:22