Bitcoin Forum
May 02, 2024, 04:10:38 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Totally Noob: How to check That Your Private Key Is Random  (Read 134 times)
Husires (OP)
Legendary
*
Offline Offline

Activity: 1596
Merit: 1285



View Profile WWW
January 30, 2022, 08:43:41 PM
 #1

We knows that well-reviewed software is better, but it's better to find some alternatives.

I found some javascripts that allow you to generate offline private key randomly, what are the important parts of the code that I guarantee that the private key will be generated

  • randomly
  • unique (as same level as electrum)

Please: Dont say just download electrum or any other well-reviewed software.

.BEST..CHANGE.███████████████
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
███████████████
..BUY/ SELL CRYPTO..
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714666238
Hero Member
*
Offline Offline

Posts: 1714666238

View Profile Personal Message (Offline)

Ignore
1714666238
Reply with quote  #2

1714666238
Report to moderator
hatshepsut93
Legendary
*
Offline Offline

Activity: 2954
Merit: 2145



View Profile
January 30, 2022, 08:53:14 PM
Merited by DdmrDdmr (6), o_e_l_e_o (4), fillippone (3), pooya87 (2), stompix (2), ABCbits (2)
 #2

We knows that well-reviewed software is better, but it's better to find some alternatives.

Please: Dont say just download electrum or any other well-reviewed software.

No it's not better to find some alternatives, it's better to use the widely used and reviewed solution with a good reputation.

Please: Dont say just download electrum or any other well-reviewed software.

What's the point of asking questions if you only want to hear answers that would validate your opinion?

  • randomly
  • unique (as same level as electrum)

The low-hanging fruit would be to check that the function used to get random values is  Crypto.getRandomValues() and not Math.random() or some library.

But it's pointless, you need to make a full software review to decide if the software is safe or not. If you don't have a high-lavel expertise in the target programming language, you won't be able to do it.

.BEST.CHANGE..███████████████
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
███████████████
..BUY/ SELL CRYPTO..
pooya87
Legendary
*
Offline Offline

Activity: 3444
Merit: 10526



View Profile
January 31, 2022, 05:23:06 AM
 #3

Please: Dont say just download electrum or any other well-reviewed software.
Well, that's the correct answer because the alternative is for you to be an expert in that particular language (like the javascript you mentioned above) and review the code yourself. I'm not familiar with javascript to tell you where to look and what to look for, if it were c# and  you had posted a link to the source code of the project you were planning to use, then I would be able to look at it and point out what to look for. So the answer is for you to stick to well reviewed software such as Electrum or Bitcoin Core.

Keep in mind that it is not enough to just look at the random() function, you have to see what the whole code is doing. It may have the correct random() function but the button you click in UI may not even use that!

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
witcher_sense
Legendary
*
Offline Offline

Activity: 2324
Merit: 4316

🔐BitcoinMessage.Tools🔑


View Profile WWW
January 31, 2022, 08:09:45 AM
Merited by DdmrDdmr (6)
 #4

We knows that well-reviewed software is better, but it's better to find some alternatives.

I found some javascripts that allow you to generate offline private key randomly, what are the important parts of the code that I guarantee that the private key will be generated

  • randomly
  • unique (as same level as electrum)

Please: Dont say just download electrum or any other well-reviewed software.
If you don't trust well-reviewed reputable software with which to generate random numbers, just generate them manually using cards, dice, coin flips, or other methods that provide decent entropy. The alternative to that must not be other software that is less known/reviewed and may contain unexpected bugs, vulnerabilities, and backdoors. As for other questions: you can't prove the number you get is actually random no matter what methods of generation, software, or manual, you are employing. And you can't prove its uniqueness because it would require the knowledge of all other already generated private keys which you obviously can't know.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
ABCbits
Legendary
*
Offline Offline

Activity: 2870
Merit: 7447


Crypto Swap Exchange


View Profile
January 31, 2022, 10:02:50 AM
Merited by fillippone (3)
 #5

  • randomly
  • unique (as same level as electrum)

How about this?

Code:
xxd -l 32 -ps /dev/urandom
# 1bcfc845367bb56264f8fba8886fefa86294ac96c86ef269f1ad208b1b1faa48

Please: Dont say just download electrum or any other well-reviewed software.

Why not? It's most practical option if you're not cryptography/math expert.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
NeuroticFish
Legendary
*
Offline Offline

Activity: 3654
Merit: 6371


Looking for campaign manager? Contact icopress!


View Profile
January 31, 2022, 02:17:20 PM
 #6

Please: Dont say just download electrum or any other well-reviewed software.

You can use tools that can help you generate your wallet seed based on the results of a dice:
https://bitcointalk.org/index.php?topic=5317199.msg58955841#msg58955841
I know that from that point on you will have to create your private key from the seed.

You should read that thread, maybe you get more ideas for what you want to achieve.


Or, after all, the private key is just an awfully large integer.
If I've read/calculated it correctly, it's a number between 1 and 115792089237316195423570985008687907852837564279074904382605163141518161494337
You can easily pick yourself a number in that range (and convert it into WIF). But, as others said, there's quite a good chance you'll go for some "nice pattern" and will make your private key weak.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
bitmover
Legendary
*
Online Online

Activity: 2296
Merit: 5914


bitcoindata.science


View Profile WWW
January 31, 2022, 06:14:09 PM
Merited by fillippone (3)
 #7


I found some javascripts that allow you to generate offline private key randomly, what are the important parts of the code that I guarantee that the private key will be generated

I think you basically need to reviews the code.
Do you mindset sharing it?

Javascript's randomness is not very good.
For example, Math.random()  is not really random. So if your scripts uses it, I think it is not good.
https://hackernoon.com/how-does-javascripts-math-random-generate-random-numbers-ef0de6a20131


You can try some libs such as
https://github.com/bitcoinjs/bitcoinjs-lib
https://bcoin.io/

I never used them.. but you can even run a full node using bcoin

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!