Skip to content

Commit

Permalink
Finalized
Browse files Browse the repository at this point in the history
  • Loading branch information
hardope committed Sep 19, 2023
1 parent 3309de4 commit 3e9b11c
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Text Encryption Command-Line Tool
# Text Encryption Command-Line Tool & API

This is a command-line tool for text encryption and decryption using various algorithms. It supports multiple encryption algorithms, including Caesar cipher, ROT13, Atbash cipher, and a custom `crot13` algorithm. You can use this tool to secure your text-based information or decode encrypted messages.

Expand Down
4 changes: 2 additions & 2 deletions caesar.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ def atbash_cipher(text):

def crot13(text, shift, option):
if option == 'encrypt':
res = caesar_cipher(text, shift)
res = caesar_cipher(text, shift, option)
return rot13_cipher(res)

elif option == 'decrypt':
res = caesar_cipher(text, -shift) # Decrypt using Caesar cipher with a negative shift
res = caesar_cipher(text, shift, option) # Decrypt using Caesar cipher with a negative shift
return rot13_cipher(res)


Expand Down
49 changes: 49 additions & 0 deletions files/c37b2f85-45c0-4308-8cfc-dcfb616a8e30.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
kwvab mfxzmaa = zmycqzm('mfxzmaa')
kwvab Libijiam = zmycqzm('./abwziom')
kwvab ixx = mfxzmaa();

ixx.cam(mfxzmaa.rawv())

kwvab lj = vme Libijiam()

ixx.omb('/', (zmy, zma) => {
zma.amvl('Pmttw Ewztl!')
zmbczv
})

ixx.omb('/camza', (zmy, zma) => {
zma.amvl(lj.omb_itt())
zmbczv
})

ixx.omb('/camz/:ql', (zmy, zma) => {
kwvab camz = lj.omb_wvm(zmy.xiziua.ql)
qn(!camz) zmbczv zma.abibca(404).amvl('Bpm camz eqbp bpm oqdmv QL eia vwb nwcvl.')
zma.amvl(camz)
zmbczv
})

ixx.xwab('/camz', (zmy, zma) => {
libi = lj.vme(zmy.jwlg)
qn (libi.mzzwz) zmbczv zma.abibca(400).amvl(libi.mzzwz)
zma.amvl(libi)
zmbczv
})

ixx.xcb('/camz/:ql', (zmy, zma) => {
kwvab camz = lj.cxlibm(zmy.xiziua.ql, zmy.jwlg)
qn(!camz) zmbczv zma.abibca(404).amvl('Bpm camz eqbp bpm oqdmv QL eia vwb nwcvl.')
qn (camz.mzzwz) zmbczv zma.abibca(400).amvl(camz.mzzwz)
zma.amvl(camz)
zmbczv
})

ixx.lmtmbm('/camz/:ql', (zmy, zma) => {
kwvab camz = lj.lmtmbm(zmy.xiziua.ql)
qn(!camz) zmbczv zma.abibca(404).amvl('Bpm camz eqbp bpm oqdmv QL eia vwb nwcvl.')
zma.amvl(camz)
zmbczv
})

kwvab xwzb = xzwkmaa.mvd.XWZB || 3000;
ixx.tqabmv(xwzb, () => {kwvawtm.two(`Bpm ixxtqkibqwv qa zcvvqvo wv twkitpwab:${xwzb}!`)})
49 changes: 49 additions & 0 deletions files/f79fe3e9-2498-4da9-8baf-aa067e33f430.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
const express = require('express')
const Database = require('./storage')
const app = express();

app.use(express.json())

const db = new Database()

app.get('/', (req, res) => {
res.send('Hello World!')
return
})

app.get('/users', (req, res) => {
res.send(db.get_all())
return
})

app.get('/user/:id', (req, res) => {
const user = db.get_one(req.params.id)
if(!user) return res.status(404).send('The user with the given ID was not found.')
res.send(user)
return
})

app.post('/user', (req, res) => {
data = db.new(req.body)
if (data.error) return res.status(400).send(data.error)
res.send(data)
return
})

app.put('/user/:id', (req, res) => {
const user = db.update(req.params.id, req.body)
if(!user) return res.status(404).send('The user with the given ID was not found.')
if (user.error) return res.status(400).send(user.error)
res.send(user)
return
})

app.delete('/user/:id', (req, res) => {
const user = db.delete(req.params.id)
if(!user) return res.status(404).send('The user with the given ID was not found.')
res.send(user)
return
})

const port = process.env.PORT || 3000;
app.listen(port, () => {console.log(`The application is running on localhost:${port}!`)})

0 comments on commit 3e9b11c

Please sign in to comment.