----------------------------------------
> Date: Tue, 31 Mar 2009 04:59:07 -0700
> From: spam haven CT
> To: [email protected]
> Subject: Re: [iText-questions] Hash computation problem
>
>
> Thank you Paulo.
> Anyway I'd like to know more about this aspect.
> Which object (stamper, signature appearance) does generate this ID (is a
> sort of pseudo-random identifier)?
> Is this ID saved into the final pdf?
> Can you give me a link to a document containing this aspects?
Can you look at the pdf format spec or reference documents?
I grepped these and they contain all kinds of references to
RFC's and things.
IIRC, you were asking about using an SHA1 hash and
I was a bit curious too about the random part. If you
are familiar with various encryption paradigms-
signatures to avoid tampering, non-repudiation signatures,
etc- you can appreciate needs to guard against things
like replay attacks etc so a random component wouldn't be
surprising in many cases.
for signatures, see things like this,
http://en.wikipedia.org/wiki/Digital_Signature_Algorithm
You can also grep the source code which is reasonably
well written and commented. If you grep for Random,
( you may not get all instances in which pseudorandom
numbers are used as they could be buried inside jarred
libraries but for illustration)
you get a lot of RandomAccess hits but eliminating these
( obviously you need to check this constraint LOL )
gives you a tractable set of things to examine,
cat xxx | while read ; do grep -H "Random[^A]" "$REPLY" ; done | sed -e 's/^[^
]*\///'
CFFFont.java: "UNKNOWN_12_16", "LanguageGroup", "ExpansionFactor",
"initialRandomSeed",
PdfPublicKeySecurityHandler.java:import java.security.SecureRandom;
PdfPublicKeySecurityHandler.java: key.init(192, new SecureRandom());
PdfPublicKeySecurityHandler.java: seed =
SecureRandom.getSeed(SEED_LENGTH);
RtfDocument.java: private ArrayList previousRandomInts = null;
RtfDocument.java: this.previousRandomInts = new ArrayList();
RtfDocument.java: public int getRandomInt() {
RtfDocument.java: } while(this.previousRandomInts.contains(newInt));
RtfDocument.java: this.previousRandomInts.add(newInt);
RtfShape.java: this.shapeNr = this.doc.getRandomInt();
RtfList.java: result.write(intToByteArray(document.getRandomInt()));
RtfListLevel.java: templateID = document.getRandomInt();
RtfListLevel.java: templateID = document.getRandomInt();
RtfListLevel.java: templateID = document.getRandomInt();
l.setID(document.getRandomInt());
RtfListTable.java: l.setID(document.getRandomInt());
RtfAnnotation.java:
result.write(intToByteArray(document.getRandomInt()));
PdfFile.java: * @param pdf a Random Access File or Array
RtfTestBase.java: public void testRandomText() throws IOException {
MultiColumnR2L.java:import java.util.Random;
MultiColumnR2L.java: static Random rand = new Random();
MultiColumnSimple.java:import java.util.Random;
MultiColumnSimple.java: static Random rand = new Random();
>
> Thank you again
> --
> View this message in context:
> http://www.nabble.com/Hash-computation-problem-tp22801988p22803631.html
> Sent from the iText - General mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
> Buy the iText book: http://www.1t3xt.com/docs/book.php
_________________________________________________________________
Express your personality in color! Preview and select themes for HotmailĀ®.
http://www.windowslive-hotmail.com/LearnMore/personalize.aspx?ocid=TXT_MSGTX_WL_HM_express_032009#colortheme
------------------------------------------------------------------------------
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://www.1t3xt.com/docs/book.php