0% found this document useful (0 votes)
30 views

Image Encryption Viva Questions

Uploaded by

Pranav Shingne
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views

Image Encryption Viva Questions

Uploaded by

Pranav Shingne
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Image Encryption Applet Viva Questions and Answers

1. What is the main functionality of this program?


This program provides a graphical user interface (GUI) for uploading an image, encrypting
it using the AES algorithm, and decrypting it back to its original form. It also displays the
uploaded, encrypted (scrambled), and decrypted images.

2. What cryptographic algorithm is used in this program, and why?


The program uses the AES (Advanced Encryption Standard) algorithm for encrypting and
decrypting images. AES is chosen because it is fast, secure, and widely used for symmetric
key encryption.

3. How is the image encrypted?


1. The image is first read into a byte array using a ByteArrayOutputStream.
2. The AES Cipher is initialized in ENCRYPT_MODE with a randomly generated secret key.
3. The byte array of the image is encrypted using the Cipher.

4. How is the encrypted image displayed?


A simulated 'scrambled' version of the uploaded image is displayed using the
scrambleImage method. This scrambling does not represent actual encryption but is
visually used for illustration purposes.

5. How is the image decrypted?


1. The encrypted byte array is decrypted using the AES Cipher initialized in
DECRYPT_MODE with the same secret key used for encryption.
2. The decrypted byte array is then converted back to a BufferedImage and displayed.

6. What is the role of the secret key in this program?


The secret key is essential for both encryption and decryption. It ensures that only
authorized users with the correct key can decrypt the encrypted image.

7. What library is used for GUI development?


The program uses the Swing library to create the graphical user interface, including buttons,
labels, and the layout.

8. Why do you use the scrambleImage method?


The scrambleImage method is used to visually represent an 'encrypted' image by randomly
shuffling the pixels. This is for demonstration purposes, as the actual encrypted image data
cannot be displayed directly.
9. What happens if an invalid or non-image file is uploaded?
If an invalid file is uploaded, the program shows an error message, 'Invalid image format,'
and does not proceed with encryption.

10. How is the uploaded image displayed in the GUI?


The uploaded image is scaled to fit within a label (400x400 pixels) using ImageIcon and
SCALE_SMOOTH for proper rendering.

11. How is the file format of the image handled?


The method getFileExtension extracts the file extension of the uploaded image
(e.g., .jpg, .png). This format is used during encryption and decryption to ensure the file's
integrity.

12. Why is KeyGenerator used in the program?


KeyGenerator is used to generate a random 128-bit AES key. This ensures the encryption is
secure.

13. How are encrypted and decrypted images stored?


After decryption, the image is saved as decrypted_image.jpg in the current directory using
ImageIO.write.

14. What are the security concerns in this program?


1. The secret key is not securely stored or shared.
2. If the program terminates, the key is lost, and the encrypted data becomes unrecoverable.
3. The scrambling method is not a secure encryption method—it's only for display
purposes.

15. What improvements can you suggest for this program?


1. Key Storage: Use a secure mechanism to store and retrieve the key.
2. Error Handling: Improve error messages and edge case handling (e.g., large image files).
3. Encrypted Image Display: Display the actual encrypted byte data as a visual
representation rather than scrambling.
4. Support for Higher Bit Keys: Allow AES-192 or AES-256 for stronger encryption.

You might also like