tests/testthat/test-running_key.R

test_that("Encryption works", {
  expect_equal(running_key("testmessage", "thisisakeytothecipher"), "mlaluwsceex")
})

test_that("Decryption works", {
  expect_equal(running_key("mlaluwsceex", "thisisakeytothecipher", decrypt = TRUE), "testmessage")
})

test_that("Key must be longer than x", {
  expect_error(running_key("testmessage", "key"))
})

Try the cipheR package in your browser

Any scripts or data that you put into this service are public.

cipheR documentation built on Nov. 16, 2022, 5:15 p.m.