Example of cryptography random number












2












$begingroup$


I read that random numbers are being used in cryptography and security. I think I have idea how to truly generate true random, non-deterministic number. But before continuing further I'd like to ask few basic questions.




  1. What kind of numbers are needed for cryptography/security? Are those integers?

  2. How long should those numbers be? 10 digits, 100 digits?

  3. I read few articles about random numbers, but did I get it right, they are used to create hashes to create stronger encryption?










share|improve this question









New contributor




FosAvance is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$








  • 2




    $begingroup$
    I think I have idea how to truly generate true random, non-deterministic number. Could you explain it further how you would do it?
    $endgroup$
    – AleksanderRas
    4 hours ago










  • $begingroup$
    Welcome to crypto.stackexchange - 3 of the 5 tags that you included on your question were unrelated to the question that you have asked. Please only use tags that are relevant to the content of your question.
    $endgroup$
    – Ella Rose
    3 hours ago






  • 1




    $begingroup$
    It obviously is 4.
    $endgroup$
    – Ivan Kolmychek
    2 hours ago










  • $begingroup$
    @AleksanderRas Maybe I'm wrong about my idea, but my idea would be to use human movement to get the number since human's movement is always random and almost non-predictable
    $endgroup$
    – FosAvance
    2 hours ago
















2












$begingroup$


I read that random numbers are being used in cryptography and security. I think I have idea how to truly generate true random, non-deterministic number. But before continuing further I'd like to ask few basic questions.




  1. What kind of numbers are needed for cryptography/security? Are those integers?

  2. How long should those numbers be? 10 digits, 100 digits?

  3. I read few articles about random numbers, but did I get it right, they are used to create hashes to create stronger encryption?










share|improve this question









New contributor




FosAvance is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$








  • 2




    $begingroup$
    I think I have idea how to truly generate true random, non-deterministic number. Could you explain it further how you would do it?
    $endgroup$
    – AleksanderRas
    4 hours ago










  • $begingroup$
    Welcome to crypto.stackexchange - 3 of the 5 tags that you included on your question were unrelated to the question that you have asked. Please only use tags that are relevant to the content of your question.
    $endgroup$
    – Ella Rose
    3 hours ago






  • 1




    $begingroup$
    It obviously is 4.
    $endgroup$
    – Ivan Kolmychek
    2 hours ago










  • $begingroup$
    @AleksanderRas Maybe I'm wrong about my idea, but my idea would be to use human movement to get the number since human's movement is always random and almost non-predictable
    $endgroup$
    – FosAvance
    2 hours ago














2












2








2





$begingroup$


I read that random numbers are being used in cryptography and security. I think I have idea how to truly generate true random, non-deterministic number. But before continuing further I'd like to ask few basic questions.




  1. What kind of numbers are needed for cryptography/security? Are those integers?

  2. How long should those numbers be? 10 digits, 100 digits?

  3. I read few articles about random numbers, but did I get it right, they are used to create hashes to create stronger encryption?










share|improve this question









New contributor




FosAvance is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$




I read that random numbers are being used in cryptography and security. I think I have idea how to truly generate true random, non-deterministic number. But before continuing further I'd like to ask few basic questions.




  1. What kind of numbers are needed for cryptography/security? Are those integers?

  2. How long should those numbers be? 10 digits, 100 digits?

  3. I read few articles about random numbers, but did I get it right, they are used to create hashes to create stronger encryption?







random-number-generator randomness






share|improve this question









New contributor




FosAvance is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




FosAvance is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 3 hours ago









Ella Rose

15.8k44280




15.8k44280






New contributor




FosAvance is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 4 hours ago









FosAvanceFosAvance

1142




1142




New contributor




FosAvance is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





FosAvance is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






FosAvance is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








  • 2




    $begingroup$
    I think I have idea how to truly generate true random, non-deterministic number. Could you explain it further how you would do it?
    $endgroup$
    – AleksanderRas
    4 hours ago










  • $begingroup$
    Welcome to crypto.stackexchange - 3 of the 5 tags that you included on your question were unrelated to the question that you have asked. Please only use tags that are relevant to the content of your question.
    $endgroup$
    – Ella Rose
    3 hours ago






  • 1




    $begingroup$
    It obviously is 4.
    $endgroup$
    – Ivan Kolmychek
    2 hours ago










  • $begingroup$
    @AleksanderRas Maybe I'm wrong about my idea, but my idea would be to use human movement to get the number since human's movement is always random and almost non-predictable
    $endgroup$
    – FosAvance
    2 hours ago














  • 2




    $begingroup$
    I think I have idea how to truly generate true random, non-deterministic number. Could you explain it further how you would do it?
    $endgroup$
    – AleksanderRas
    4 hours ago










  • $begingroup$
    Welcome to crypto.stackexchange - 3 of the 5 tags that you included on your question were unrelated to the question that you have asked. Please only use tags that are relevant to the content of your question.
    $endgroup$
    – Ella Rose
    3 hours ago






  • 1




    $begingroup$
    It obviously is 4.
    $endgroup$
    – Ivan Kolmychek
    2 hours ago










  • $begingroup$
    @AleksanderRas Maybe I'm wrong about my idea, but my idea would be to use human movement to get the number since human's movement is always random and almost non-predictable
    $endgroup$
    – FosAvance
    2 hours ago








2




2




$begingroup$
I think I have idea how to truly generate true random, non-deterministic number. Could you explain it further how you would do it?
$endgroup$
– AleksanderRas
4 hours ago




$begingroup$
I think I have idea how to truly generate true random, non-deterministic number. Could you explain it further how you would do it?
$endgroup$
– AleksanderRas
4 hours ago












$begingroup$
Welcome to crypto.stackexchange - 3 of the 5 tags that you included on your question were unrelated to the question that you have asked. Please only use tags that are relevant to the content of your question.
$endgroup$
– Ella Rose
3 hours ago




$begingroup$
Welcome to crypto.stackexchange - 3 of the 5 tags that you included on your question were unrelated to the question that you have asked. Please only use tags that are relevant to the content of your question.
$endgroup$
– Ella Rose
3 hours ago




1




1




$begingroup$
It obviously is 4.
$endgroup$
– Ivan Kolmychek
2 hours ago




$begingroup$
It obviously is 4.
$endgroup$
– Ivan Kolmychek
2 hours ago












$begingroup$
@AleksanderRas Maybe I'm wrong about my idea, but my idea would be to use human movement to get the number since human's movement is always random and almost non-predictable
$endgroup$
– FosAvance
2 hours ago




$begingroup$
@AleksanderRas Maybe I'm wrong about my idea, but my idea would be to use human movement to get the number since human's movement is always random and almost non-predictable
$endgroup$
– FosAvance
2 hours ago










2 Answers
2






active

oldest

votes


















7












$begingroup$

What kind of numbers are needed for cryptography/security? Are those integers?



Bits. Simply have your TRNG generate random bits.



As mentioned in the other answer, the only difference between bits/hex/integers/etc is in the formatting and representation. It is almost certainly more appropriate and simpler to generate random bits than it is to rely on some process to generate a random integers in a given range.



How long should those numbers be? 10 digits, 100 digits?



256 bits is sufficient for any one user. You can take a 256-bits of uniformly random information and use it to generate an arbitrary amount of uniformly random information (for practical purposes) using a CSPRNG.



I read few articles about random numbers, but did I get it right, they are used to create hashes to create stronger encryption?




  • Random numbers are not required to create hashes


    • Typical hash functions are deterministic algorithms

    • Random numbers may be used as part of an input to a hash function, depending on context



  • Hashing is not related to encryption


    • The two are sometimes used in conjunction, but encryption is not (typically) built from hash functions



  • "stronger encryption"


    • Random numbers are required to securely use a cipher (e.g. for keys, IVs)

    • But the algorithms themselves such as AES and ChaCha are nigh unbreakable and so cannot be "stronger"








share|improve this answer











$endgroup$









  • 3




    $begingroup$
    "You can take a 256-bits of uniformly random information and use it to generate an arbitrary amount of uniformly random information using a CSPRNG." I would not call the output of a CSPRNG uniformly random information. Perhaps computationally indistinguishable from uniformly random information, or uniformly random information for practical purposes.
    $endgroup$
    – fgrieu
    2 hours ago












  • $begingroup$
    Thanks for the answer. Maybe I'm wrong about my idea, but my idea would be to use human movement to get the number since human's movement is always random and almost non-predictable
    $endgroup$
    – FosAvance
    2 hours ago










  • $begingroup$
    @FosAvance A persons movement while situated in front of a computer is actually highly predictable; They don't move very much. Also: a modern computer already takes advantage of information based on user interaction to extract entropy. Information related to events such as key presses and mouse movement/clicks are fed into an entropy pool. None of that changes the recommendations of the above answer however.
    $endgroup$
    – Ella Rose
    2 hours ago










  • $begingroup$
    @EllaRose I didn't say anything about being situated in front of a computer
    $endgroup$
    – FosAvance
    11 mins ago



















2












$begingroup$


I think I have an idea how to truly generate true random, non-deterministic numbers.




If you have a normal computer you actually can't create truly random numbers, unless you have dedicated hardware (hardware random number generator) that produces truly random numbers. If you don't have that then the best you can do are Cryptographically secure pseudorandom numbers.



What kind of numbers are needed for cryptography/security? Are those integers?



Once you have a random number you can also change the representation of it, for example an interger, Hex, binary, etc. It depends on the usage.




  • Do you need a salt? $rightarrow$ alphanumerical

  • Do you need it for mathematical cryptography like asymmetric encryption? $rightarrow$ integer


  • $ldots$


How long should those numbers be? 10 digits, 100 digits?



Depends:




  • The encryption scheme known as RSA uses fairly large prime numbers i.e. 1024-bit ($approx$ 310 digits). You generate a 1024-bit number and increment the number until you have reached a prime number. This answer gives some additional information.


  • If you want to create a simple coin-toss application you only need to produce a 1-bit random value (i.e. $0 =$ head, $1 =$ tails).



[$ldots$] did I get it right, random numbers are used to create hashes to create stronger encryption?



Random numbers have a large application (especially in cryptography).



About hashes:



Hashes are deterministic. That means that some input always has exactly the same hash-value. No matter when, where or anything, an identical hashing-algorithm creates always the same hash-value for an identical input. The idea of random numbers is that they create (almost every time) a different number.



Encryption:



Random numbers indeed play an important role for encryption. Almost every encryption-scheme makes use of random number generators.






share|improve this answer











$endgroup$









  • 1




    $begingroup$
    “If you have a normal computer you actually can't create truly random numbers” This is not true. It is very common for a computer these days to include a hardware entropy source (RDRAND on Intel, hardware RNG on most smartphones, even many microcontrollers include an RNG these days). “Cryptographically secure random numbers” I think you meant pseudorandom, otherwise the whole paragraph is useless — but it's actually wrong.
    $endgroup$
    – Gilles
    2 hours ago












  • $begingroup$
    This was really helpful, thank you :)
    $endgroup$
    – FosAvance
    2 hours ago











Your Answer





StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "281"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});






FosAvance is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcrypto.stackexchange.com%2fquestions%2f67073%2fexample-of-cryptography-random-number%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









7












$begingroup$

What kind of numbers are needed for cryptography/security? Are those integers?



Bits. Simply have your TRNG generate random bits.



As mentioned in the other answer, the only difference between bits/hex/integers/etc is in the formatting and representation. It is almost certainly more appropriate and simpler to generate random bits than it is to rely on some process to generate a random integers in a given range.



How long should those numbers be? 10 digits, 100 digits?



256 bits is sufficient for any one user. You can take a 256-bits of uniformly random information and use it to generate an arbitrary amount of uniformly random information (for practical purposes) using a CSPRNG.



I read few articles about random numbers, but did I get it right, they are used to create hashes to create stronger encryption?




  • Random numbers are not required to create hashes


    • Typical hash functions are deterministic algorithms

    • Random numbers may be used as part of an input to a hash function, depending on context



  • Hashing is not related to encryption


    • The two are sometimes used in conjunction, but encryption is not (typically) built from hash functions



  • "stronger encryption"


    • Random numbers are required to securely use a cipher (e.g. for keys, IVs)

    • But the algorithms themselves such as AES and ChaCha are nigh unbreakable and so cannot be "stronger"








share|improve this answer











$endgroup$









  • 3




    $begingroup$
    "You can take a 256-bits of uniformly random information and use it to generate an arbitrary amount of uniformly random information using a CSPRNG." I would not call the output of a CSPRNG uniformly random information. Perhaps computationally indistinguishable from uniformly random information, or uniformly random information for practical purposes.
    $endgroup$
    – fgrieu
    2 hours ago












  • $begingroup$
    Thanks for the answer. Maybe I'm wrong about my idea, but my idea would be to use human movement to get the number since human's movement is always random and almost non-predictable
    $endgroup$
    – FosAvance
    2 hours ago










  • $begingroup$
    @FosAvance A persons movement while situated in front of a computer is actually highly predictable; They don't move very much. Also: a modern computer already takes advantage of information based on user interaction to extract entropy. Information related to events such as key presses and mouse movement/clicks are fed into an entropy pool. None of that changes the recommendations of the above answer however.
    $endgroup$
    – Ella Rose
    2 hours ago










  • $begingroup$
    @EllaRose I didn't say anything about being situated in front of a computer
    $endgroup$
    – FosAvance
    11 mins ago
















7












$begingroup$

What kind of numbers are needed for cryptography/security? Are those integers?



Bits. Simply have your TRNG generate random bits.



As mentioned in the other answer, the only difference between bits/hex/integers/etc is in the formatting and representation. It is almost certainly more appropriate and simpler to generate random bits than it is to rely on some process to generate a random integers in a given range.



How long should those numbers be? 10 digits, 100 digits?



256 bits is sufficient for any one user. You can take a 256-bits of uniformly random information and use it to generate an arbitrary amount of uniformly random information (for practical purposes) using a CSPRNG.



I read few articles about random numbers, but did I get it right, they are used to create hashes to create stronger encryption?




  • Random numbers are not required to create hashes


    • Typical hash functions are deterministic algorithms

    • Random numbers may be used as part of an input to a hash function, depending on context



  • Hashing is not related to encryption


    • The two are sometimes used in conjunction, but encryption is not (typically) built from hash functions



  • "stronger encryption"


    • Random numbers are required to securely use a cipher (e.g. for keys, IVs)

    • But the algorithms themselves such as AES and ChaCha are nigh unbreakable and so cannot be "stronger"








share|improve this answer











$endgroup$









  • 3




    $begingroup$
    "You can take a 256-bits of uniformly random information and use it to generate an arbitrary amount of uniformly random information using a CSPRNG." I would not call the output of a CSPRNG uniformly random information. Perhaps computationally indistinguishable from uniformly random information, or uniformly random information for practical purposes.
    $endgroup$
    – fgrieu
    2 hours ago












  • $begingroup$
    Thanks for the answer. Maybe I'm wrong about my idea, but my idea would be to use human movement to get the number since human's movement is always random and almost non-predictable
    $endgroup$
    – FosAvance
    2 hours ago










  • $begingroup$
    @FosAvance A persons movement while situated in front of a computer is actually highly predictable; They don't move very much. Also: a modern computer already takes advantage of information based on user interaction to extract entropy. Information related to events such as key presses and mouse movement/clicks are fed into an entropy pool. None of that changes the recommendations of the above answer however.
    $endgroup$
    – Ella Rose
    2 hours ago










  • $begingroup$
    @EllaRose I didn't say anything about being situated in front of a computer
    $endgroup$
    – FosAvance
    11 mins ago














7












7








7





$begingroup$

What kind of numbers are needed for cryptography/security? Are those integers?



Bits. Simply have your TRNG generate random bits.



As mentioned in the other answer, the only difference between bits/hex/integers/etc is in the formatting and representation. It is almost certainly more appropriate and simpler to generate random bits than it is to rely on some process to generate a random integers in a given range.



How long should those numbers be? 10 digits, 100 digits?



256 bits is sufficient for any one user. You can take a 256-bits of uniformly random information and use it to generate an arbitrary amount of uniformly random information (for practical purposes) using a CSPRNG.



I read few articles about random numbers, but did I get it right, they are used to create hashes to create stronger encryption?




  • Random numbers are not required to create hashes


    • Typical hash functions are deterministic algorithms

    • Random numbers may be used as part of an input to a hash function, depending on context



  • Hashing is not related to encryption


    • The two are sometimes used in conjunction, but encryption is not (typically) built from hash functions



  • "stronger encryption"


    • Random numbers are required to securely use a cipher (e.g. for keys, IVs)

    • But the algorithms themselves such as AES and ChaCha are nigh unbreakable and so cannot be "stronger"








share|improve this answer











$endgroup$



What kind of numbers are needed for cryptography/security? Are those integers?



Bits. Simply have your TRNG generate random bits.



As mentioned in the other answer, the only difference between bits/hex/integers/etc is in the formatting and representation. It is almost certainly more appropriate and simpler to generate random bits than it is to rely on some process to generate a random integers in a given range.



How long should those numbers be? 10 digits, 100 digits?



256 bits is sufficient for any one user. You can take a 256-bits of uniformly random information and use it to generate an arbitrary amount of uniformly random information (for practical purposes) using a CSPRNG.



I read few articles about random numbers, but did I get it right, they are used to create hashes to create stronger encryption?




  • Random numbers are not required to create hashes


    • Typical hash functions are deterministic algorithms

    • Random numbers may be used as part of an input to a hash function, depending on context



  • Hashing is not related to encryption


    • The two are sometimes used in conjunction, but encryption is not (typically) built from hash functions



  • "stronger encryption"


    • Random numbers are required to securely use a cipher (e.g. for keys, IVs)

    • But the algorithms themselves such as AES and ChaCha are nigh unbreakable and so cannot be "stronger"









share|improve this answer














share|improve this answer



share|improve this answer








edited 2 hours ago

























answered 2 hours ago









Ella RoseElla Rose

15.8k44280




15.8k44280








  • 3




    $begingroup$
    "You can take a 256-bits of uniformly random information and use it to generate an arbitrary amount of uniformly random information using a CSPRNG." I would not call the output of a CSPRNG uniformly random information. Perhaps computationally indistinguishable from uniformly random information, or uniformly random information for practical purposes.
    $endgroup$
    – fgrieu
    2 hours ago












  • $begingroup$
    Thanks for the answer. Maybe I'm wrong about my idea, but my idea would be to use human movement to get the number since human's movement is always random and almost non-predictable
    $endgroup$
    – FosAvance
    2 hours ago










  • $begingroup$
    @FosAvance A persons movement while situated in front of a computer is actually highly predictable; They don't move very much. Also: a modern computer already takes advantage of information based on user interaction to extract entropy. Information related to events such as key presses and mouse movement/clicks are fed into an entropy pool. None of that changes the recommendations of the above answer however.
    $endgroup$
    – Ella Rose
    2 hours ago










  • $begingroup$
    @EllaRose I didn't say anything about being situated in front of a computer
    $endgroup$
    – FosAvance
    11 mins ago














  • 3




    $begingroup$
    "You can take a 256-bits of uniformly random information and use it to generate an arbitrary amount of uniformly random information using a CSPRNG." I would not call the output of a CSPRNG uniformly random information. Perhaps computationally indistinguishable from uniformly random information, or uniformly random information for practical purposes.
    $endgroup$
    – fgrieu
    2 hours ago












  • $begingroup$
    Thanks for the answer. Maybe I'm wrong about my idea, but my idea would be to use human movement to get the number since human's movement is always random and almost non-predictable
    $endgroup$
    – FosAvance
    2 hours ago










  • $begingroup$
    @FosAvance A persons movement while situated in front of a computer is actually highly predictable; They don't move very much. Also: a modern computer already takes advantage of information based on user interaction to extract entropy. Information related to events such as key presses and mouse movement/clicks are fed into an entropy pool. None of that changes the recommendations of the above answer however.
    $endgroup$
    – Ella Rose
    2 hours ago










  • $begingroup$
    @EllaRose I didn't say anything about being situated in front of a computer
    $endgroup$
    – FosAvance
    11 mins ago








3




3




$begingroup$
"You can take a 256-bits of uniformly random information and use it to generate an arbitrary amount of uniformly random information using a CSPRNG." I would not call the output of a CSPRNG uniformly random information. Perhaps computationally indistinguishable from uniformly random information, or uniformly random information for practical purposes.
$endgroup$
– fgrieu
2 hours ago






$begingroup$
"You can take a 256-bits of uniformly random information and use it to generate an arbitrary amount of uniformly random information using a CSPRNG." I would not call the output of a CSPRNG uniformly random information. Perhaps computationally indistinguishable from uniformly random information, or uniformly random information for practical purposes.
$endgroup$
– fgrieu
2 hours ago














$begingroup$
Thanks for the answer. Maybe I'm wrong about my idea, but my idea would be to use human movement to get the number since human's movement is always random and almost non-predictable
$endgroup$
– FosAvance
2 hours ago




$begingroup$
Thanks for the answer. Maybe I'm wrong about my idea, but my idea would be to use human movement to get the number since human's movement is always random and almost non-predictable
$endgroup$
– FosAvance
2 hours ago












$begingroup$
@FosAvance A persons movement while situated in front of a computer is actually highly predictable; They don't move very much. Also: a modern computer already takes advantage of information based on user interaction to extract entropy. Information related to events such as key presses and mouse movement/clicks are fed into an entropy pool. None of that changes the recommendations of the above answer however.
$endgroup$
– Ella Rose
2 hours ago




$begingroup$
@FosAvance A persons movement while situated in front of a computer is actually highly predictable; They don't move very much. Also: a modern computer already takes advantage of information based on user interaction to extract entropy. Information related to events such as key presses and mouse movement/clicks are fed into an entropy pool. None of that changes the recommendations of the above answer however.
$endgroup$
– Ella Rose
2 hours ago












$begingroup$
@EllaRose I didn't say anything about being situated in front of a computer
$endgroup$
– FosAvance
11 mins ago




$begingroup$
@EllaRose I didn't say anything about being situated in front of a computer
$endgroup$
– FosAvance
11 mins ago











2












$begingroup$


I think I have an idea how to truly generate true random, non-deterministic numbers.




If you have a normal computer you actually can't create truly random numbers, unless you have dedicated hardware (hardware random number generator) that produces truly random numbers. If you don't have that then the best you can do are Cryptographically secure pseudorandom numbers.



What kind of numbers are needed for cryptography/security? Are those integers?



Once you have a random number you can also change the representation of it, for example an interger, Hex, binary, etc. It depends on the usage.




  • Do you need a salt? $rightarrow$ alphanumerical

  • Do you need it for mathematical cryptography like asymmetric encryption? $rightarrow$ integer


  • $ldots$


How long should those numbers be? 10 digits, 100 digits?



Depends:




  • The encryption scheme known as RSA uses fairly large prime numbers i.e. 1024-bit ($approx$ 310 digits). You generate a 1024-bit number and increment the number until you have reached a prime number. This answer gives some additional information.


  • If you want to create a simple coin-toss application you only need to produce a 1-bit random value (i.e. $0 =$ head, $1 =$ tails).



[$ldots$] did I get it right, random numbers are used to create hashes to create stronger encryption?



Random numbers have a large application (especially in cryptography).



About hashes:



Hashes are deterministic. That means that some input always has exactly the same hash-value. No matter when, where or anything, an identical hashing-algorithm creates always the same hash-value for an identical input. The idea of random numbers is that they create (almost every time) a different number.



Encryption:



Random numbers indeed play an important role for encryption. Almost every encryption-scheme makes use of random number generators.






share|improve this answer











$endgroup$









  • 1




    $begingroup$
    “If you have a normal computer you actually can't create truly random numbers” This is not true. It is very common for a computer these days to include a hardware entropy source (RDRAND on Intel, hardware RNG on most smartphones, even many microcontrollers include an RNG these days). “Cryptographically secure random numbers” I think you meant pseudorandom, otherwise the whole paragraph is useless — but it's actually wrong.
    $endgroup$
    – Gilles
    2 hours ago












  • $begingroup$
    This was really helpful, thank you :)
    $endgroup$
    – FosAvance
    2 hours ago
















2












$begingroup$


I think I have an idea how to truly generate true random, non-deterministic numbers.




If you have a normal computer you actually can't create truly random numbers, unless you have dedicated hardware (hardware random number generator) that produces truly random numbers. If you don't have that then the best you can do are Cryptographically secure pseudorandom numbers.



What kind of numbers are needed for cryptography/security? Are those integers?



Once you have a random number you can also change the representation of it, for example an interger, Hex, binary, etc. It depends on the usage.




  • Do you need a salt? $rightarrow$ alphanumerical

  • Do you need it for mathematical cryptography like asymmetric encryption? $rightarrow$ integer


  • $ldots$


How long should those numbers be? 10 digits, 100 digits?



Depends:




  • The encryption scheme known as RSA uses fairly large prime numbers i.e. 1024-bit ($approx$ 310 digits). You generate a 1024-bit number and increment the number until you have reached a prime number. This answer gives some additional information.


  • If you want to create a simple coin-toss application you only need to produce a 1-bit random value (i.e. $0 =$ head, $1 =$ tails).



[$ldots$] did I get it right, random numbers are used to create hashes to create stronger encryption?



Random numbers have a large application (especially in cryptography).



About hashes:



Hashes are deterministic. That means that some input always has exactly the same hash-value. No matter when, where or anything, an identical hashing-algorithm creates always the same hash-value for an identical input. The idea of random numbers is that they create (almost every time) a different number.



Encryption:



Random numbers indeed play an important role for encryption. Almost every encryption-scheme makes use of random number generators.






share|improve this answer











$endgroup$









  • 1




    $begingroup$
    “If you have a normal computer you actually can't create truly random numbers” This is not true. It is very common for a computer these days to include a hardware entropy source (RDRAND on Intel, hardware RNG on most smartphones, even many microcontrollers include an RNG these days). “Cryptographically secure random numbers” I think you meant pseudorandom, otherwise the whole paragraph is useless — but it's actually wrong.
    $endgroup$
    – Gilles
    2 hours ago












  • $begingroup$
    This was really helpful, thank you :)
    $endgroup$
    – FosAvance
    2 hours ago














2












2








2





$begingroup$


I think I have an idea how to truly generate true random, non-deterministic numbers.




If you have a normal computer you actually can't create truly random numbers, unless you have dedicated hardware (hardware random number generator) that produces truly random numbers. If you don't have that then the best you can do are Cryptographically secure pseudorandom numbers.



What kind of numbers are needed for cryptography/security? Are those integers?



Once you have a random number you can also change the representation of it, for example an interger, Hex, binary, etc. It depends on the usage.




  • Do you need a salt? $rightarrow$ alphanumerical

  • Do you need it for mathematical cryptography like asymmetric encryption? $rightarrow$ integer


  • $ldots$


How long should those numbers be? 10 digits, 100 digits?



Depends:




  • The encryption scheme known as RSA uses fairly large prime numbers i.e. 1024-bit ($approx$ 310 digits). You generate a 1024-bit number and increment the number until you have reached a prime number. This answer gives some additional information.


  • If you want to create a simple coin-toss application you only need to produce a 1-bit random value (i.e. $0 =$ head, $1 =$ tails).



[$ldots$] did I get it right, random numbers are used to create hashes to create stronger encryption?



Random numbers have a large application (especially in cryptography).



About hashes:



Hashes are deterministic. That means that some input always has exactly the same hash-value. No matter when, where or anything, an identical hashing-algorithm creates always the same hash-value for an identical input. The idea of random numbers is that they create (almost every time) a different number.



Encryption:



Random numbers indeed play an important role for encryption. Almost every encryption-scheme makes use of random number generators.






share|improve this answer











$endgroup$




I think I have an idea how to truly generate true random, non-deterministic numbers.




If you have a normal computer you actually can't create truly random numbers, unless you have dedicated hardware (hardware random number generator) that produces truly random numbers. If you don't have that then the best you can do are Cryptographically secure pseudorandom numbers.



What kind of numbers are needed for cryptography/security? Are those integers?



Once you have a random number you can also change the representation of it, for example an interger, Hex, binary, etc. It depends on the usage.




  • Do you need a salt? $rightarrow$ alphanumerical

  • Do you need it for mathematical cryptography like asymmetric encryption? $rightarrow$ integer


  • $ldots$


How long should those numbers be? 10 digits, 100 digits?



Depends:




  • The encryption scheme known as RSA uses fairly large prime numbers i.e. 1024-bit ($approx$ 310 digits). You generate a 1024-bit number and increment the number until you have reached a prime number. This answer gives some additional information.


  • If you want to create a simple coin-toss application you only need to produce a 1-bit random value (i.e. $0 =$ head, $1 =$ tails).



[$ldots$] did I get it right, random numbers are used to create hashes to create stronger encryption?



Random numbers have a large application (especially in cryptography).



About hashes:



Hashes are deterministic. That means that some input always has exactly the same hash-value. No matter when, where or anything, an identical hashing-algorithm creates always the same hash-value for an identical input. The idea of random numbers is that they create (almost every time) a different number.



Encryption:



Random numbers indeed play an important role for encryption. Almost every encryption-scheme makes use of random number generators.







share|improve this answer














share|improve this answer



share|improve this answer








edited 2 hours ago

























answered 3 hours ago









AleksanderRasAleksanderRas

2,2021630




2,2021630








  • 1




    $begingroup$
    “If you have a normal computer you actually can't create truly random numbers” This is not true. It is very common for a computer these days to include a hardware entropy source (RDRAND on Intel, hardware RNG on most smartphones, even many microcontrollers include an RNG these days). “Cryptographically secure random numbers” I think you meant pseudorandom, otherwise the whole paragraph is useless — but it's actually wrong.
    $endgroup$
    – Gilles
    2 hours ago












  • $begingroup$
    This was really helpful, thank you :)
    $endgroup$
    – FosAvance
    2 hours ago














  • 1




    $begingroup$
    “If you have a normal computer you actually can't create truly random numbers” This is not true. It is very common for a computer these days to include a hardware entropy source (RDRAND on Intel, hardware RNG on most smartphones, even many microcontrollers include an RNG these days). “Cryptographically secure random numbers” I think you meant pseudorandom, otherwise the whole paragraph is useless — but it's actually wrong.
    $endgroup$
    – Gilles
    2 hours ago












  • $begingroup$
    This was really helpful, thank you :)
    $endgroup$
    – FosAvance
    2 hours ago








1




1




$begingroup$
“If you have a normal computer you actually can't create truly random numbers” This is not true. It is very common for a computer these days to include a hardware entropy source (RDRAND on Intel, hardware RNG on most smartphones, even many microcontrollers include an RNG these days). “Cryptographically secure random numbers” I think you meant pseudorandom, otherwise the whole paragraph is useless — but it's actually wrong.
$endgroup$
– Gilles
2 hours ago






$begingroup$
“If you have a normal computer you actually can't create truly random numbers” This is not true. It is very common for a computer these days to include a hardware entropy source (RDRAND on Intel, hardware RNG on most smartphones, even many microcontrollers include an RNG these days). “Cryptographically secure random numbers” I think you meant pseudorandom, otherwise the whole paragraph is useless — but it's actually wrong.
$endgroup$
– Gilles
2 hours ago














$begingroup$
This was really helpful, thank you :)
$endgroup$
– FosAvance
2 hours ago




$begingroup$
This was really helpful, thank you :)
$endgroup$
– FosAvance
2 hours ago










FosAvance is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















FosAvance is a new contributor. Be nice, and check out our Code of Conduct.













FosAvance is a new contributor. Be nice, and check out our Code of Conduct.












FosAvance is a new contributor. Be nice, and check out our Code of Conduct.
















Thanks for contributing an answer to Cryptography Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


Use MathJax to format equations. MathJax reference.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcrypto.stackexchange.com%2fquestions%2f67073%2fexample-of-cryptography-random-number%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Callistus I

Tabula Rosettana

How to label and detect the document text images