Initial commit
This commit is contained in:
27
test.sh
Executable file
27
test.sh
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "Testing OTP Cipher Implementation"
|
||||
echo "================================="
|
||||
|
||||
# Test 1: Generate a pad
|
||||
echo "Test 1: Generating pad..."
|
||||
./otp generate test 2
|
||||
echo
|
||||
|
||||
# Test 2: Check if files were created
|
||||
echo "Test 2: Checking generated files..."
|
||||
ls -la test.pad test.state
|
||||
echo
|
||||
|
||||
# Test 3: Test encryption
|
||||
echo "Test 3: Testing encryption..."
|
||||
echo "Secret Message" | ./otp encrypt test > encrypted_output.txt
|
||||
cat encrypted_output.txt
|
||||
echo
|
||||
|
||||
# Test 4: Test decryption
|
||||
echo "Test 4: Testing decryption..."
|
||||
cat encrypted_output.txt | ./otp decrypt test
|
||||
echo
|
||||
|
||||
echo "Tests completed!"
|
||||
Reference in New Issue
Block a user