예제 #1
0
        static IVGenerator()
        {
            arcfour = new ARCFOUREncryption();
            long   time = SystemUtil.GetTimeBasedSeed();
            long   mem  = SystemUtil.GetFreeMemory();
            String s    = time + "+" + mem;

            arcfour.PrepareARCFOURKey(s.GetBytes(iText.IO.Util.EncodingUtil.ISO_8859_1));
        }
예제 #2
0
        static IVGenerator()
        {
            arcfour = new ARCFOUREncryption();
            long   time = SystemUtil.GetSystemTimeTicks();
            long   mem  = SystemUtil.GetFreeMemory();
            String s    = time + "+" + mem;

            arcfour.PrepareARCFOURKey(s.GetBytes());
        }
예제 #3
0
        public static byte[] GenerateNewDocumentId()
        {
            IDigest md5;

            try {
                md5 = DigestUtilities.GetDigest("MD5");
            }
            catch (Exception e) {
                throw new PdfException(PdfException.PdfEncryption, e);
            }
            long   time = SystemUtil.GetTimeBasedSeed();
            long   mem  = SystemUtil.GetFreeMemory();
            String s    = time + "+" + mem + "+" + (seq++);

            return(md5.Digest(s.GetBytes(iText.IO.Util.EncodingUtil.ISO_8859_1)));
        }
예제 #4
0
        public static byte[] GenerateNewDocumentId()
        {
            IDigest md5;

            try {
                md5 = Org.BouncyCastle.Security.DigestUtilities.GetDigest("MD5");
            }
            catch (Exception e) {
                throw new PdfException(PdfException.PdfEncryption, e);
            }
            long   time = SystemUtil.GetSystemTimeTicks();
            long   mem  = SystemUtil.GetFreeMemory();
            String s    = time + "+" + mem + "+" + (seq++);

            return(md5.Digest(s.GetBytes()));
        }