decryptr
is an R package to break CAPTCHAs. It is also an extensible tool
built in a way that enables anyone to contribute with their own CAPTCHA-breaking
code.
To install decryptr
, simply run the code below:
if (!require(devtools)) install.packages("devtools") devtools::install_github("decryptr/decryptr")
It is also recommended to install decryptrModels
package.
devtools::install_github("decryptr/decryptrModels")
decryptr
has functions for downloading and breaking captchas from multiple
sources, one of which is TJMG (a court in southern Brazil). Here is how one
could break captchas from TJMG:
library(decryptr) # Download captchas captcha <- download_tjmg(dest = 'img') # Draw captcha captcha %>% read_captcha() %>% plot()
captcha %>% read_captcha() %>% classify() # plots the image and opens the console #> Answer:
# Load model (install decryptrModels package first) keras_tjmg <- decryptrModels::read_model('tjmg') data('tjmg', package = 'decryptr') tjmg$model <- keras_tjmg captcha %>% read_captcha() %>% predict(tjmg, arq = .)
Once loaded to memory, Keras models are extremely fast. Also, we don't run any pre-processing on the image.
break_captcha <- function() { captcha %>% read_captcha() %>% predict(tjmg, arq = .) } microbenchmark::microbenchmark(break_captcha())
Since decryptr
is built on top of S3 methods, anyone can extend its functionalities with custom packages. Simply create a download_<ext>
function, a read_<ext>
function, and a predict.<ext>
function and you're good to go.
More information about extensibility can be found on decryptr
's documentation.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.