Reputation: 8722
One of the reason I use StAX is because of it low memory consumption in processing large xml files.
I've been requested to encrypt the whole xml files, and decrypt them later.
The easier solution I can come up with, without having major change to existing code, is encrypt content only.
xsw.writeStartElement("row");
xsw.writeCharacters(Encrypter.encrypt("z"));
xsw.writeEndElement();
However people still can understand the structure of the data. What if I want to encrypt everything in xml? Any Solution? Bear in mind that I am dealing with large xml file :)
Thanks.
Upvotes: 1
Views: 319
Reputation: 99195
Use CipherInputStream/CipherOutputStream and pipe your StAX stream through it, IMO it'd be more efficient and secure than encrypting values only.
Upvotes: 2