-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
380c091
commit c628ed5
Showing
9 changed files
with
145 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
runRing <- function(){ | ||
shiny::runApp(system.file("shinyapp", package = "keepitsecret")) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
inst/shinyapp/rsconnect/shinyapps.io/websaur/keepitsecret.dcf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
name: keepitsecret | ||
title: | ||
username: websaur | ||
account: websaur | ||
server: shinyapps.io | ||
hostUrl: https://api.shinyapps.io/v1 | ||
appId: 12282208 | ||
bundleId: 8831578 | ||
url: https://websaur.shinyapps.io/keepitsecret/ | ||
version: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
library(shiny) | ||
library(keepitsecret) | ||
|
||
server <- function(input, output, session) { | ||
|
||
values <- reactiveValues() | ||
|
||
gen_pw <- eventReactive(input$generate, { | ||
if(input$method == "word"){ | ||
values$pw <- keep_it_safe(input$method, input$n, input$cap, input$sep, min_size = input$min_size[1], max_size = input$min_size[2]) | ||
} else if(input$method == "sentence"){ | ||
values$pw <- keep_it_safe(input$method, input$n) | ||
} else if(input$method == "phrase"){ | ||
values$pw <- keep_it_safe(input$method, input$n, input$sep) | ||
} | ||
|
||
print(values$pw) | ||
}) | ||
|
||
safe <- eventReactive(input$generate, { | ||
values$safe <- is_it_safe(values$pw, verbose = F) | ||
print(values$safe$crack_times_display$online_no_throttling_10_per_second) | ||
}) | ||
|
||
secret <- eventReactive(input$generate, { | ||
values$secret <- is_it_secret(values$pw) | ||
print(values$secret) | ||
}) | ||
|
||
output$password <- renderText({ | ||
gen_pw() | ||
}) | ||
|
||
output$password_strength <- renderText({ | ||
paste("Time to crack:", safe()) | ||
}) | ||
|
||
output$password_secrecy <- renderText({ | ||
paste("Appearances in data breaches:", secret()) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
library(shiny) | ||
library(bslib) | ||
|
||
ui <- page_sidebar( | ||
theme = bs_theme(bootswatch = "darkly"), | ||
sidebar = sidebar( | ||
img(src = "hexsticker.png", width = 150, style = "margin-left: auto; margin-right: auto;"), | ||
# Select variable for y-axis | ||
selectInput( | ||
inputId = "method", | ||
label = "Method", | ||
choices = c( | ||
"Random words" = "word", | ||
"Sentence method" = "sentence", | ||
"Phrase method" = "phrase" | ||
), | ||
selected = "word" | ||
), | ||
conditionalPanel( | ||
condition = "input.method == 'word'", | ||
sliderInput("n", "How many words?", | ||
min = 1, max = 10, value = 4 | ||
), | ||
sliderInput("min_size", "Word size", | ||
min = 2, max = 10, value = c(4, 6), | ||
), | ||
radioButtons("cap", "Capitalisation", | ||
choices = c("original", "none", "title"), | ||
selected = "original" | ||
), | ||
textInput("sep", "Separator", | ||
value = "-", | ||
placeholder = "e.g. a space, ';' or '-'" | ||
) | ||
), | ||
conditionalPanel( | ||
condition = "input.method == 'sentence'", | ||
sliderInput("digit_count", "How many words?", | ||
min = 1, max = 10, value = 6 | ||
), | ||
textInput("sep", "Separator", | ||
value = "-", | ||
placeholder = "e.g. a space, ';' or '-'" | ||
) | ||
), | ||
conditionalPanel( | ||
condition = "input.method == 'phrase'", | ||
sliderInput("digit_count", "How many words?", | ||
min = 1, max = 10, value = 4 | ||
) | ||
), | ||
actionButton("generate", "Generate password"), | ||
), | ||
|
||
# Output: Generate password | ||
card( | ||
h3("Your new password"), | ||
h4(textOutput(outputId = "password")) | ||
), | ||
card( | ||
h3("Password strength"), | ||
h4(textOutput(outputId = "password_strength")), | ||
h4(textOutput(outputId = "password_secrecy")) | ||
) | ||
) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.