using floydpink's method (github rsa)