项目作者: abimarticio

项目描述 :
Spring Boot application for Caesar cipher and Atbash cipher.
高级语言: Java
项目地址: git://github.com/abimarticio/cipher-springboot.git
创建时间: 2020-10-20T06:33:29Z
项目社区:https://github.com/abimarticio/cipher-springboot

开源协议:GNU General Public License v3.0

下载


Atbash and Caesar Cipher Spring Boot

Overview

An implementation of Atbash and Caesar cipher algorithm as a Spring Boot application.

Pre-requisites

This project has the following dependencies,

  • Java JDK 11
  • Spring Boot 2.3.4

Usage

In this repository, we implement the Atbash and Caesar cipher algorithms. To use these algorithms, we have the following view functions:

  • /atbash/encrypt for Atbash encryption. The request parameter for this function is text.
  • /atbash/decrypt for Atbash decryption. The request parameter for this function is text.
  • /caesar/encrypt for Caesar encryption. The request parameters for this function are text and key.
  • /caesar/decrypt for Caesar decryption. The request parameters for this function are text and key.

To run this app, we can use Maven:

  1. $ ./mvnw spring-boot:run

We can call our API in Python through the following manner,

  1. >>> import requests
  2. >>> r = requests.get("http://localhost:8080/atbash/encrypt?text=hello")
  3. >>> r.status_code
  4. 200
  5. >>> r.text
  6. 'SVOOL'
  7. >>> r = requests.get("http://localhost:8080/atbash/decrypt?text=svool")
  8. >>> r.text
  9. 'HELLO'
  10. >>> r = requests.get("http://localhost:8080/caesar/encrypt?text=hello&key=2")
  11. >>> r.status_code
  12. 200
  13. >>> r.text
  14. 'JGNNQ'
  15. >>> r = requests.get("http://localhost:8080/caesar/decrypt?text=jgnnq&key=2")
  16. >>> r.text
  17. 'HELLO'

We can call our API using curl command in the following manner,

  1. $ curl -s -X GET "localhost:8080/atbash/encrypt?text=hello"
  2. SVOOL
  3. $ curl -s -X GET "localhost:8080/atbash/decrypt?text=svool"
  4. HELLO
  5. $ curl -s -X GET "localhost:8080/caesar/encrypt?text=hello&key=2"
  6. JGNNQ
  7. $ curl -s -X GET "localhost:8080/caesar/decrypt?text=jgnnq&key=2"
  8. HELLO

License

  1. Atbash and Caesar cipher Spring Boot app
  2. Copyright (C) 2020 Abigail Marticio
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation, either version 3 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <https://www.gnu.org/licenses></https:>.