|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.harvard.deas.hyperenc.vsat.TrueRandomSource
edu.harvard.deas.hyperenc.vsat.FileRandomSource
public class FileRandomSource
FileRandomSource (FRS) traverses the file system collecting random data. Then, it encrypts, compresses and then xor's the resulting pages to produce a final page to hand to the PSN
Field Summary | |
---|---|
static int |
NUM_PAGES
Number of random pages to combine into the final random page |
Fields inherited from class edu.harvard.deas.hyperenc.vsat.TrueRandomSource |
---|
DATA_LENGTH |
Constructor Summary | |
---|---|
FileRandomSource()
Simple constructor to initialize components |
Method Summary | |
---|---|
byte[] |
compressPage(byte[] page)
Returns the result of compressing the given page or null if we hit problems XXX Remove the temporary hack of zero-padding |
byte[] |
encryptPage(byte[] page)
Returns the result of encrypting the given page using a random key with Triple DES, or null if it encounters an error |
boolean |
genFileData(File startNode)
Function to gather random data from the file system Randomly selects a target depth and then calls fileSearch to do the actual descent |
byte[] |
genRandomness()
Pieces everything together: Gathers file data and then encrypts, compresses and xor's pages to return a page of random data Returns null if it encounters an error |
byte[] |
xor(byte[] page1,
byte[] page2)
Computes the byte-wise xor of page1 and page2 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int NUM_PAGES
Constructor Detail |
---|
public FileRandomSource()
Method Detail |
---|
public byte[] genRandomness()
genRandomness
in class TrueRandomSource
public byte[] xor(byte[] page1, byte[] page2)
public byte[] encryptPage(byte[] page)
page
- The array of bytes to be encryptedpublic byte[] compressPage(byte[] page)
page
- An array of FILE_READ_SIZE bytes to be compressed
public boolean genFileData(File startNode)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |