7.7: Ethical Issues Around Data Collection
Note: 7.7 is not tested on the AP Exam!
ArrayLists and other data structures are used to store data stored in databases, either on one's computer or on the internet. When using programs, this data has the potential to be at risk. This is why it is important to safeguard this data. There are many ways to make this secure using cryptography and encapsulation that may be used to keep this data safe.
Encapsulation is where we block data from being used by outside clients. To do this, we keep data private inside the classes that we write as covered in Unit 5. To access this information, the only way to do this is by using methods that are available publicly to the user. Otherwise, no other classes or objects can use this data.
Cryptography is the act of securing our data and there are two ways: hash functions and ciphers. Hash functions encrypt data using complex mathematical functions and are non-reversible. Because of its nonreversabilty, hash functions are not used to transmit information, but are instead used for integrity, to show that the data we are being sent is genuine. Whether it is the right data or not is left to ciphers. Ciphers allow us to encrypt our data so that it can't be read or understood by outside sources, but they can be reversed. To reverse the cipher, we need to have access to the key. The key is either common to both the sender and receiver of the data or unique to each person. However, using the key or keys, the message can successfully be decoded efficiently. However, without the key, the data can still be intercepted by a third-party. Most likely, the third-party will probably not be able to decode the data because decrypting it by brute force will require complex math and much time brute-forcing a solution that it isn't worth trying to decode the data without a key.