You are on page 1of 4

Fibonacci ecryption

Encrypts and decrypts a string using the Fibonacci sequence. It is a very simple
program.
Note:
The preprocessing stage converts all of the letters of the string into lowercase and
removes any character that is not a letter, period, or space. That includes numbers and
commas.
Methodology:
The project uses
- encryption/decryption algorithms
- key dependent
(Key is used while encrypting message as well will be use while decrypting)

Advantage:
The advantage of the proposed project is to make information secure by encrypting it on mentioned
criteria. The application is taking file instead of messages so in short it is saving time by encrypting all
strings written on that file. The files is only decrypted if the receiver party know the key and feed that key
in the system.

The proposed encryption/decryption algorithm is loss-less, key-dependent.


The Fibonacci sequence works with the code represented in the movie because each integer n can be
represented by a sum of nonconsecutive Fibonacci numbers.

In addition, as each n also has a unique representation in terms of the Fibonacci numbers, one number
would not have the same coded value as another number. This helps eliminate any confusion in the
decryption process as well, since no two values can correspond to the same 4 plaintext message.

Source Message is: abcd


Password is: xyz

Steps in the Encryption Algorithm

1. The source message is reversed i.e abcd is written as dcba.

2. The password is appended i.e the cipher text becomes dcbaxyz.

3. The Fibonacci series, up to the length of the password is generated. In our case, the
password length is 3, so the first three Fibonacci terms viz. 1, 1, 2 are generated. Start the
Fibonacci series from 1 instead of 0.

4. Every element in odd position in the cipher text is forwarded by the current Fibonacci term,
i.e. in the first iteration all odd indexed elements would be advanced by 1, in the second
iteration by 1, in the third iteration by 2 and so on. Once 'z' is reached, we wrap around i.e. if
we forward 'z' or 'Z' by 1 the output would be 'a' or 'A'. Similarly, every element in even position
in the cipher text is reversed by the current Fibonacci term, i.e. in the first iteration all even
elements would be reversed by 1, in the next iteration by 1, in the next by 2 and so on. Once 'a'
is reached, wrap around i.e. if we reverse 'a' or 'A' by 1 the output would be 'z' or 'Z'.

5. So, in our case the Encryption iteration for the cipher text 'dcbaxyz' would be,

* ebczyxa when the current fibonacci term is 1

* fadyzwb when the current fibonacci term is 1


* hyfwbud when the current fibonacci term is 2

6. So, our resultant encrypted string would be 'hyfwbud'.

RSA Encryption
The most common public-key algorithm is the RSA cryptosystem

Based on exponentiation in a finite (Galois) field over integers modulo a


prime.

So it uses large integers (eg. 1024 bits)

Provides security due to cost of factoring large numbers.

XOR CIPHER
The XOR encryption algorithm is an example of symmetric encryption where the same
key is used to both encrypt and decrypt a message.

It is a very effective yet easy to implement method of symmetric encryption.

In the code we are using the XOR bitwise operator ( ^) to apply the XOR mask using the
plain text and the key.

You might also like