Crypto Flexs
  • DIRECTORY
  • CRYPTO
    • ETHEREUM
    • BITCOIN
    • ALTCOIN
  • BLOCKCHAIN
  • EXCHANGE
  • ADOPTION
  • TRADING
  • HACKING
  • SLOT
  • TRADE
Crypto Flexs
  • DIRECTORY
  • CRYPTO
    • ETHEREUM
    • BITCOIN
    • ALTCOIN
  • BLOCKCHAIN
  • EXCHANGE
  • ADOPTION
  • TRADING
  • HACKING
  • SLOT
  • TRADE
Crypto Flexs
Home»BITCOIN NEWS»Security – Are there any major flaws in this seed-phrase encryption scheme?
BITCOIN NEWS

Security – Are there any major flaws in this seed-phrase encryption scheme?

By Crypto FlexsJuly 26, 20242 Mins Read
Facebook Twitter Pinterest LinkedIn Tumblr Email
Security – Are there any major flaws in this seed-phrase encryption scheme?
Share
Facebook Twitter LinkedIn Pinterest Email

I would like to add some security to my seed phrase storage for my existing wallet. I don’t want to make it absolutely secure, I just want to make it much harder for someone to access my funds if they find my seed phrase storage.

I am considering these approaches:

  1. Convert seed phrase to entropy
  2. Entropy encryption with password
  3. Convert the encrypted entropy into a new (longer) seed phrase.
  4. Save your encrypted seed phrase

Then, when necessary, we work backwards to retrieve the initial seed phrase.

I’ve included JS code below to demonstrate it. It’s not needed for decryption since I used AES CEB with no initial vector and an empty key salt.

I’m wondering if there’s a major flaw in my approach or code.

Please note that by using a password to secure your seed phrase vault, you increase the likelihood that you will lose access to your seed phrase vault if you forget your password.


import crypto from "crypto";
import bip39 from "bip39-light";

const algorithm = "aes-256-ecb";
const initialVector = null;
const keySize = 32;
const keySalt = "";

const inputPassword = ""; // password goes here
const inputMnemonic = ""; // 12 word seed phrase goes here

// encrypt 12-word input mnemonic to 24-word mnemonic
const encryptedMnemonic = encryptMnemonic(inputMnemonic, inputPassword);

// decrypt 24-word mnemonic back to 12-word mnemonic
const decryptedMnemonic = decryptMnemonic(encryptedMnemonic, inputPassword);

console.log( inputMnemonic, encryptedMnemonic, decryptedMnemonic );

function encryptMnemonic(mnemonic, password) 
  const key = crypto.scryptSync(password, keySalt, keySize);

  const entropy = bip39.mnemonicToEntropy(mnemonic);
    
  const cipher = crypto.createCipheriv(algorithm, key, initialVector);
  
  let encryptedEntropy = cipher.update(entropy, "hex", "hex");
  encryptedEntropy += cipher.final("hex");
  
  let encryptedMnemonic = bip39.entropyToMnemonic(encryptedEntropy);
  return encryptedMnemonic;


function decryptMnemonic(mnemonic, password) 
  const key = crypto.scryptSync(password, keySalt, keySize);

  let encryptedEntropy = bip39.mnemonicToEntropy(mnemonic);
  
  const decipher = crypto.createDecipheriv(algorithm, key, initialVector);
  
  let decryptedEntropy = decipher.update(encryptedEntropy, "hex", "hex");
  decryptedEntropy += decipher.final("hex");
    
  let decryptedMnemonic = bip39.entropyToMnemonic(decryptedEntropy);
  return decryptedMnemonic;

Share. Facebook Twitter Pinterest LinkedIn Tumblr Email

Related Posts

Sequans starts $ 384M Bitcoin Treasury Initiative with Swan Bitcoin Partnership.

June 23, 2025

ECB Chairman Lagarde aims to seize the global order to strengthen the Euro’s global position.

June 17, 2025

Bitcoin aims for $ 115K after US CPI data prefers investors.

June 11, 2025
Add A Comment

Comments are closed.

Recent Posts

Safe smart account audit summary

June 27, 2025

CARV’s New Roadmap Signals Next Wave Of Web3 AI

June 27, 2025

CARV’s New Roadmap Signals Next Wave Of Web3 AI

June 27, 2025

Bybit Expands Global Reach With Credit Card Crypto Purchases In 25+ Currencies And Cashback Rewards

June 27, 2025

BYDFi Joins Seoul Meta Week 2025, Advancing Web3 Vision And South Korea Strategy

June 27, 2025

Earns $9,800 Per Day With BTC Breaks Through $107,000, GoldenMining Global Market.

June 27, 2025

Why Bakkt Holdings can buy Bitcoin with a $ 1 billion increase

June 27, 2025

NVIDIA RTX strengthens FITY’s AI -centered innovation in Cooler Design.

June 27, 2025

Join Earn Mining To Mine Easily And Earn $7752 A Day

June 26, 2025

Bitcoin prices return to green -building exercise for more profits

June 26, 2025

Weed® Announces Partnership With Khalifa Kush; Launches Global Commercialization

June 26, 2025

Crypto Flexs is a Professional Cryptocurrency News Platform. Here we will provide you only interesting content, which you will like very much. We’re dedicated to providing you the best of Cryptocurrency. We hope you enjoy our Cryptocurrency News as much as we enjoy offering them to you.

Contact Us : Partner(@)Cryptoflexs.com

Top Insights

Safe smart account audit summary

June 27, 2025

CARV’s New Roadmap Signals Next Wave Of Web3 AI

June 27, 2025

CARV’s New Roadmap Signals Next Wave Of Web3 AI

June 27, 2025
Most Popular

Coinbase Adds Support for the Anticipated Polygon (MATIC) Rebranding Token Polygon Ecosystem Token (POL)

September 6, 2024

Trader Michaël van de Poppe updates Bitcoin outlook, says Ethereum competitor could surge more than 200% in a matter of months

September 12, 2024

Cryptocurrency exchange Coinbase adds support for Solana-based decentralized GPU network altcoins

October 10, 2024
  • Home
  • About Us
  • Contact Us
  • Disclaimer
  • Privacy Policy
  • Terms and Conditions
© 2025 Crypto Flexs

Type above and press Enter to search. Press Esc to cancel.