Database Applications for Managers Spring 2008  BU4040

Home  |  Syllabus  |  Journal  | Project Exam Research  |  Gallery

Journal Wednesday

 March 26th, 2008

Q1- Your task is to encrypt all sensitive data (security, privacy) in your database and get rid of the original data (delete files or fields ). -The key for running the encryption is "the quick brown fox jumps over the lazy dog". program is not case sensitive, deal with special characters and numbers in your own creative way. To test your program decrypt the data to get to original database. The test data input is HELLO and the encrypted output you should get is PTFFB. Hint, you may want to use an other key for numbers and special characters.(40 points)

"the quick brown fox jumps over the lazy dog"
 abcdefghijklmnopqrstuvwxyz, skip letters that are repeated such as "o", "e"

Q2- You are to design a database from scratch using any file access and memory access mode (sequential, random, array, object, etc.) Be unique and creative. You may want to use C++ or any programming language you are familiar with. show your data file and queries.(30 points)

 

Q3- you are to design a database using access, DB2, Oracle, etc. Use your own SQL query to access the similar data as in question two. (30 points)

ENCRYPTION EXAMPLE
Following is a sample PL/SQL program to encrypt data. Segments of the code are numbered and contain
narrative text explaining portions of the code.
DECLARE
input_string VARCHAR2(16) := ’tigertigertigert’;
key_string VARCHAR2(8) := ’scottsco’;
encrypted_string VARCHAR2(2048);
decrypted_string VARCHAR2(2048);
error_in_input_buffer_length EXCEPTION;
PRAGMA EXCEPTION_INIT(error_in_input_buffer_length, -28232);
INPUT_BUFFER_LENGTH_ERR_MSG VARCHAR2(100) :=
’*** DES INPUT BUFFER NOT A MULTIPLE OF 8 BYTES ***’;
1. Test string data encryption and decryption-- The interface
for encrypting raw data is similar.
BEGIN           This is the beginning of the program
dbms_output.put_line(’> ========= BEGIN TEST =========’);
dbms_output.put_line(’> Input String :
’ ||
input_string);
BEGIN
dbms_obfuscation_toolkit. input_string => input_string,
key_string => key_string, encrypted_string =>
encrypted_string );
dbms_output.put_line(’> encrypted string : ’
||
encrypted_string);
dbms_obfuscation_toolkit.DESDecrypt(input_string =>
encrypted_string,
key => raw_key, decrypted_string =>
decrypted_string);
dbms_output.put_line(’> Decrypted output : ’
||
decrypted_string);
dbms_output.put_line(’> ’);
if input_string = here is an "if" statement
decrypted_string THEN
dbms_output.put_line(’> DES Encryption and Decryption
successful’);
END if;
EXCEPTION
WHEN error_in_input_buffer_length THEN
dbms_output.put_line(’> ’ ||
INPUT_BUFFER_LENGTH_ERR_MSG);
END;
 

Each row (tuple) from the table is interpreted as follows: an employee has a number, a name,

a job title and a salary. Furthermore, for each employee the number of his/her manager, the

date he/she was hired, and the number of the department where he/she is working are stored.

insert into <table> [(<column i, . . . , column j>)] <query>

create table OLDEMP (

ENO number(4) not null,

HDATE date);

We now can use the table EMP to insert tuples into this new relation:

insert into OLDEMP (ENO, HDATE)

select EMPNO, HIREDATE from EMP

where HIREDATE < ’31-DEC-60’;