3 Commits

Author SHA1 Message Date
Viktoria Konschuh
6051b5f720 sha2 2026-04-22 16:39:35 +02:00
Viktoria Konschuh
b8d311adf5 Edit plaintext.txt 2026-04-22 14:08:39 +00:00
Julian Golenhofen
1eeefff2c3 task 1 2026-04-22 13:52:43 +00:00
5 changed files with 36 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
## java.util.Random
a) Numbers are generated using a linear congruential generator. They are pseudorandom and the algorithm accepts a 48-bit seed.
b) `java.util.Random` produces uniformly distributed pseudorandom numbers.
c) No, in the documentation `SecureRandom` is recommended as a good alternative for cryptographic use-cases.
## java.lang.Math.random()
java.lang.Math.random() is a wrapper for java.util.Random (therefore same as above).
## java.security.SecureRandom
a) A unpredictable source of randomness should be used, but the algorithm in use can vary since `SecureRandom.getInstance("algorithm")` exists. Multiple ones are available.
b) The distribution of numbers is completely random and unpredictable.
c) Yes, hence the name, `SecureRandom`.
## /dev/random
a) The random number generator gathers environmental noise from device drivers and other sources into an entropy pool. It keeps an estimate of the number of bits of noise in the entropy pool. From this entropy pool, random numbers are created.
b) The distribution of numbers is completely random and unpredictable.
c) Yes, all use cases are fine.
## /dev/urandom
Preferred to random except for applications that require randomness at early boot time since it is not available there. The rest is the same as for `dev/random`.

BIN
sheet01/a2/b-sha2.txt Normal file

Binary file not shown.

0
sheet01/a2/b-sha3.txt Normal file
View File

View File

@@ -0,0 +1,2 @@
plaintext.txt -Algorithm SHA256
reads the plaintext file and calculates a unique hash string using the SHA-256 cryptographic algorithm.

View File

@@ -0,0 +1,3 @@
Julian
Leonard
Viktoria