2

I expect the result to be around $40$, but I do not know how to get there?

Not necessary to read:

I'm doing this because I'm wondering how many (printable!) characters I need for a password strength of $256$ bit. $256$ bit is $2^{256}$ possibilities. In theory it would take $32$ characters, IF every character had $8$ totally random bits. But since I'm restricted to the printable characters, I only get 95 (space until ~) possibilities per $8$ bits (instead of $256$). That is how I came up with the equation above - which I think is correct, I just don't know how to solve it.

Max
  • 1,039
Robert
  • 123

2 Answers2

2

Take logs:

$$ 256 \log_2 2 = x \log_2 95 $$

and then solve for $x$.

Jason S
  • 3,109
  • log2 of 2 is 1 and log2 of 95 is ~6,57. Thus my x is 256/6,57 = ~38,96. That means I need 39 characters to get to the 256 bit security level. Thank you! – Robert Feb 11 '19 at 16:01
1

Take the logarithm of both sides to calculate the answer. The logarithm is the inverse of the exponential function. This link talks about them, in case you haven’t been introduced.

Thus, the answer is found as follows: $$95^x=2^{256}$$ $$\log_{95}\left(95^x\right)=\log_{95}\left(2^{256}\right)$$ $$x=256 \log_{95}2$$ $$x=\frac{256\log_2{2}}{\log_2 95}$$ $$x=\frac{256}{\log_295}$$