0% found this document useful (0 votes)
27 views8 pages

Lab 2

The document discusses the Vigenere cipher and rail fence cipher encryption algorithms. It provides code examples for encrypting and decrypting text using each algorithm in NetBeans. Students are instructed to write programs implementing both ciphers with options to input text, keys, and read/write files.

Uploaded by

Như Nguyễn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views8 pages

Lab 2

The document discusses the Vigenere cipher and rail fence cipher encryption algorithms. It provides code examples for encrypting and decrypting text using each algorithm in NetBeans. Students are instructed to write programs implementing both ciphers with options to input text, keys, and read/write files.

Uploaded by

Như Nguyễn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

CLASSICAL SYMMETRIC ENCRYPTION (Cont) 8

Practice 2: CLASSICAL SYMMETRIC


ENCRYPTION (Cont)

OVERVIEW

2.1.1 Introduction

- Lab 1: Ceasar Encryption Algorithm


- Practice time: class: 3 study hour, self-studying: 3 study hour.
- Requiment: Students using Netbean Software

2.1.2 Objective

- This course provides students with knowledge of cryptographic algorithms and how they
are used in today's world.
- The content emphasizes the principles, topics, approaches, and problem solving related to
the underlying technologies and architectures of the field.

CONTENTS

2.2.1 Summary

The Vigenere cipher is also known as multiple encodings. This is acodeation of this code
is the use of 26 other code table. Do that not beat in a long time. This code out but support
for use from the key is same benefit.
Algorithm:

PRACTICE INFORMATION SECURITY FACULTY OF INFORMATION TECHNOLOGY


CLASSICAL SYMMETRIC ENCRYPTION (Cont) 9

2.2.2 Vigenere Cipher

Write a program to encrypt and decrypt text with Vigenere encryption algorithm. The
program can perform the following functions:
− Allow text input into the system.
− Allows entering text protection keys.
− Allows to write File and open File.

Guide:
❖ Step 1: Create New Project -> Lab2

❖ Step 2: Design Form:

PRACTICE INFORMATION SECURITY FACULTY OF INFORMATION TECHNOLOGY


CLASSICAL SYMMETRIC ENCRYPTION (Cont) 10

❖ Step 3: Write code for initialization function:

❖ Step 4: Write an event handler function:


➢ 4.1 Encrypt function:

PRACTICE INFORMATION SECURITY FACULTY OF INFORMATION TECHNOLOGY


CLASSICAL SYMMETRIC ENCRYPTION (Cont) 11

➢ 4.2 Button Encrypt:

➢ 4.3 Button WriteFile:

➢ 4.4 Button Decrypt:

PRACTICE INFORMATION SECURITY FACULTY OF INFORMATION TECHNOLOGY


CLASSICAL SYMMETRIC ENCRYPTION (Cont) 12

➢ 4.6 Button OpenFile:

Result:

PRACTICE INFORMATION SECURITY FACULTY OF INFORMATION TECHNOLOGY


CLASSICAL SYMMETRIC ENCRYPTION (Cont) 13

2.2.3 Rail Fence Cipher

Algorithm:
− Messages are written from left to right on the rails of an imaginary row diagonally
from top to bottom.
− Diagonally from the bottom up when reaching the lowest column.
− And when you reach the top of the column, rewrite diagonally from top to bottom.
Keep repeating like this until you write all the content of the message.
Example: Plain text: Nice to meet you
Key: 2
nctmeyu
ieoeto
Cipher text: nctmeyuIeoeto
Write a program to encrypt and decrypt text with Vigenere encryption algorithm. The
program can perform the following functions:
− Allow text input into the system.
− Allows entering text protection keys.
− Allows to write File and open File.
Guide:
❖ Step 1:Create Form: Rail_Fence

PRACTICE INFORMATION SECURITY FACULTY OF INFORMATION TECHNOLOGY


CLASSICAL SYMMETRIC ENCRYPTION (Cont) 14

❖ Step 2: write code for handle:


➢ 2.1 Button Encrypt:

PRACTICE INFORMATION SECURITY FACULTY OF INFORMATION TECHNOLOGY


CLASSICAL SYMMETRIC ENCRYPTION (Cont) 15

➢ 2.2 Button Decrypt:

Result:

PRACTICE INFORMATION SECURITY FACULTY OF INFORMATION TECHNOLOGY

You might also like