Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Martin Møller Skarbiniks Pedersen MartinMSPedersen

🎯
Focusing
View GitHub Profile
View RSA_simple.R
# work-in-progress
# based on https://www.di-mgt.com.au/rsa_alg.html
library(gmp)
# returns a random odd value. The first bit and last bit is 1.
random_value <- function(how_many_bits = 512) {
hex_values <- ceiling(how_many_bits/4)-4
if (hex_values < 1) stop("more bits please.")
result <- c(
You can’t perform that action at this time.