#!/usr/bin/bc -l
scale = 14
a = 1/3
b = 2/3
#print "RSA Key Length? "
c = read()
t = l( l(2 ^ c) )
# if b < 1, then a^b == e (l(a) * b)
m = e( l(t) * b )
t = 64 / 9 * l(2 ^ c)
n = e( l(t) * a )
o = e( m * n )
p = l(o) / l(2)
print "Strength: ", p, "\n"
quit
#http://crypto.stackexchange.com/questions/8687/security-strength-of-rsa-in-relation-with-the-modulus-size/
#https://certsimple.com/blog/measuring-ssl-rsa-keys
#$ for x in 1024 2048 3072 4096 7680 8192 15360 16384
#do echo $x | ./RSA-gnfs.bc ; done
#Strength: 86.76611925027707
#Strength: 116.88381329581011
#Strength: 138.73628085271660
#Strength: 156.49695341791272
#Strength: 203.01873594416484
#Strength: 208.47248637388102
#Strength: 269.38477262126889
#Strength: 276.51840722076620
#According to this equation, if you are using AES256 as your symmetric cipher,
#then this is the minimum RSA key size that will present the same strength:
# $ echo 13547 | ./RSA-gnfs.bc
# 256.00114520595064
#Here is the minimum equivalence for "top secret" AES192:
# $ echo 6707 | ./RSA-gnfs.bc
# 192.00709600689071
#Here is the minimum equivalence for AES128:
# $ echo 2538 | ./RSA-gnfs.bc
# 128.00922533664156
#RFC-7525 specifies that "Implementations MUST NOT negotiate cipher suites
#offering less than 112 bits of security" - complying with this parameter yields
#a new minimum RSA key size:
# $ echo 1853 | ./RSA-gnfs.bc
# 112.00835107658348