%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/reportlab/lib/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/reportlab/lib/__pycache__/pdfencrypt.cpython-312.pyc

�

��d�w���dZ	ddlZddlZddlmZmZddlmZddlm	Z	ddl
mZmZm
Z
mZddlmZddlmZdd	lmZdd
lmZ	ddlZddlmZd�ZdZdZej:Zd
ZdZ dZ!dZ"dZ#dZ$dZ%e&dd�D]
Z'e%d
e'zzZ%�ejPrda)dZ*d�Z+nejXZ+Gd�d�Z-Gd�de�Z.dZ/d�Z0d�Z1e
djed�e/jg�ji�D���Z5d �Z6d4d!�Z7d"�Z8e5ddfd#�Z9d$�Z:d4d%�Z;d&�Z<d'�Z=			d5d(�Z>Gd)�d*e-e�Z?			d5d+�Z@			d5d,�ZA			d5d-�ZBd.�ZCd/�ZDeEd0k(rsej�D�cgc]
}|dd1d2k(s�|��c}ZGeGr0ej�D�cgc]
}|dd1d2k7s�|��c}e_FeHeG�Zd3ej�vre=�yeD�yy#e$rdZY��}wxYwcc}wcc}w)6z3.3.0�N)�hexlify�	unhexlify)�md5)�BytesIO)�asBytes�int2Byte�rawBytes�asNative)�Canvas)�	PDFObject)�Flowable)�	rl_config)�sha256c�:���dk(r|St�fd�|D��S)z9xor's each byte of the key with the number, which is <256rc3�(�K�|]	}�|z���y�w�N�)�.0�k�nums  ��:/usr/lib/python3/dist-packages/reportlab/lib/pdfencrypt.py�	<genexpr>zxorKey.<locals>.<genexpr>s�����$�1��Q��$�s�)�bytes)r�keys` r�xorKeyrs���
�A�v�c�z��$��$�$�$������� ��s��ܫovp��\C��B~���Eg8�f�Sj'y�G�Y��-�Q����L>��i�Ĵ'�k��p�ͪ�|��� ��Ǘ�;��,������\H}
܅��>|ŗ�T�T���!�+E#��O�j�"�ˌHB�B~�7��1.ש
�2}��m�3�/�W���K�;?�#�`W��입����#�������z��O��(z����i��!	|w,�I�_D`A�}+r-%F(@�\cL2(��BM��UG������c��t|�D�cgc]}t|tzdz��}}t|�}t|zdza|Scc}w)N�)�range�_os_random_b�_os_random_xr)�n�i�bs   r�
os_urandomr-0sJ��9>�q��B�A�\�1�\�>�3�.�
/�B��B��!�H��$�q�(�C�/�����
Cs�Ac�>�eZdZdZd
d�Zd�Zd�Zd�Zdd�Zd�Z	d	�Z
y)�StandardEncryptionrNc��||_|r||_n||_|�tj}|dk(rd|_nB|dk(rd|_n5|dk(rt
st
d��d|_nt
d	t|�z��||_||_	||_
||_dx|_x|_
x|_x|_x|_x|_|_y)
a*
        This class defines the encryption properties to be used while creating a pdf document.
        Once initiated, a StandardEncryption object can be applied to a Canvas or a BaseDocTemplate.
        The userPassword parameter sets the user password on the encrypted pdf.
        The ownerPassword parameter sets the owner password on the encrypted pdf.
        The boolean flags canPrint, canModify, canCopy, canAnnotate determine wether a user can
        perform the corresponding actions on the pdf when only a user password has been supplied.
        If the user supplies the owner password while opening the pdf, all actions can be performed regardless
        of the flags.
        Note that the security provided by these encryption settings (and even more so for the flags) is very weak.
        N�(r��r&�Astrength==256 is not supported as package pyaes is not importable��Unknown encryption strength=%s)�userPassword�
ownerPasswordr�encryptionStrength�revision�pyaes�
ValueError�repr�canPrint�	canModify�canCopy�canAnnotate�O�U�Pr�OE�UE�Perms)�selfr7r8r>r?r@rA�strengths        r�__init__zStandardEncryption.__init__<s���)����!.�D��!-�D���� �3�3�H��r�>��D�M�
��_��D�M�
��_�� �!d�e�e��D�M��=��X��N�O�O� ��
�"������&���PT�T���T���T�$�&�T�4�8�T�d�g�T���$�*rc�<�|x|_x|_x|_|_yr)r>r?r@rA)rH�values  r�setAllPermissionsz$StandardEncryption.setAllPermissions^s*��!�	!��
�	!���	!����rc���d}|jr	|tz}|jr	|tz}|jr	|t
z}|jr	|tz}|tz}|S)Nr)	r>�	printabler?�
modifiabler@�copypastablerA�annotatable�
higherbits)rH�ps  r�permissionBitsz!StandardEncryption.permissionBitscsT��
���=�=�a�)�m�!��>�>�q�:�~�1��<�<�Q��-������[��Q�
�
�N���rc���|jstd��|j�td��t|j|j|j
||j��S)zencode a string, stream, text�encryption not prepared!znot registered in PDF object�r:)�preparedr<�objnum�	encodePDFr�versionr:)rH�ts  r�encodezStandardEncryption.encodeksN���}�}��7�8�8��;�;���;�<�<�����4�;�;����a�$�-�-�X�Xrc���trtd|jz�|jrt	d��|r|}n2|j�}|jj�}trd}tr>td|jz�td|jz�td|z�t|j�dz
�|_
trd|_
tr!td	t|j�z�|jd
k(�r!d}t!d�}t!d�}t#t!d
��|_trOtdt'|�z�tdt'|�z�tdt'|j$�z�t)t#|jdd�|z�}|j�|z|z|_tr!tdt'|j*�z�t)t#|jdd�|z�}t-j.t-j0|j�|���}	|	j3|j$�|_|xj4|	j3�z
c_tr!tdt'|j4�z�t!d�}
t!d�}t)t#|jdd�|
z|j*z�}|j�|
z|z|_tr!tdt'|j6�z�t)t#|jdd�|z|j*z�}t-j.t-j0|j�|���}	|	j3|j$�|_|xj8|	j3�z
c_tr!tdt'|j8�z�|jdz|jdz	dz|jdz	dz|jdz	dzddddt;d�t;d�t;d�t;d�ddddg}t-j.t-j0|j$|���}	|	j3t=|��|_|xj>|	j3�z
c_t�r;tdt'|j>�z��n|jd v�r	tA|j|j|j�|_tr!td!t'|j6�z�tC|j|j6|j||j�"�|_tr!tdt'|j$�z�tE|j$|j|�#�|_tr!td$t'|j*�z�dx|_#|_$d|_y)%Nz-StandardEncryption.prepare(...) - revision %dzencryption already prepared!�xxxxxxxxxxxxxxxxzuserPassword    = %rzownerPassword   = %rzinternalID      = %rli���zself.P          = %sr5sr r"zuvs      (hex)  = %szuks      (hex)  = %szself.key (hex)  = %s�zself.U (hex)  = %s��ivzself.UE (hex)  = %szself.O (hex)  = %szself.OE (hex)  = %s�r!��T�a�dr,rzself.Perms (hex)  = %s�rr3zself.O (as hex) = %srX)r:�
documentIdzself.U (as hex) = %s)%�DEBUG�printr:rYr<�ID�	signature�digest�	CLOBBERIDr7r8�intrUrD�CLOBBERPERMISSIONSr=r-rr�hexTextrrCr;�	Encrypter�AESModeOfOperationCBC�feedrFrBrE�ordrrG�computeO�
encryptionkey�computeUrZr\)
rH�document�
overrideID�
internalID�
externalIDrc�uvs�uks�md�	encrypter�ovs�oks�permsarrs
             r�preparezStandardEncryption.preparers����%�G�$�-�-�W�X��=�=��;�<�<��#�J�!����J�!�+�+�2�2�4�J��/�
���(�4�+<�+<�<�=��(�4�+=�+=�=�>��(�:�5�6��T�(�(�*�U�2�3�����t�v���(�4����<�7�8��=�=�A���B��Q�-�C��Q�-�C��z�"�~�.�D�H���,�w�s�|�;�<��,�w�s�|�;�<��,�w�t�x�x�/@�@�A���� 1� 1�$�3� 7�8�3�>�?�B��Y�Y�[�3�&��,�D�F���*�W�T�V�V�_�<�=���� 1� 1�$�3� 7�8�3�>�?�B�����(C�(C�B�I�I�K�TV�(W�X�I��n�n�T�X�X�.�D�G��G�G�y�~�~�'�'�G���+�g�d�g�g�.>�>�?��Q�-�C��Q�-�C���� 2� 2�4�C� 8�9�C�?�$�&�&�H�J�B��Y�Y�[�3�&��,�D�F���*�W�T�V�V�_�<�=���� 2� 2�4�C� 8�9�C�?�$�&�&�H�I�B�����(C�(C�B�I�I�K�TV�(W�X�I��n�n�T�X�X�.�D�G��G�G�y�~�~�'�'�G���+�g�d�g�g�.>�>�?����t�#����!��t�#����"��t�#����"��t�#������C���C���C���C������!�H�(����(C�(C�D�H�H�QS�(T�U�I�"����h��8�D�J��J�J�)�.�.�*�*�J���.�����1D�D�E�
�]�]�f�
$��d�/�/��1C�1C�T�]�]�S�D�F���,�w�t�v�v��>�?�%�T�%6�%6�������
�]a�]j�]j�k�D�H���,�w�t�x�x�/@�@�A��d�h�h����:�V�D�F���,�w�t�v�v��>�?�%)�)���d�l���
rc�N�|jstd��||_||_y)NrW)rYr<rZr\)rHrZr\s   r�registerzStandardEncryption.register�s#���}�}��7�8�8������rc	���|jstd��t|j|j|j
|j|j|j|j��S)NrW�rBrErCrFrDrGr:)
rYr<�StandardEncryptionDictionaryrBrErCrFrDrGr:�rHs r�infozStandardEncryption.info�sc���}�}��7�8�8�+�d�f�f����D�F�F�t�w�w�Z^�Z`�Z`�hl�hr�hr�~B�~K�~K�L�	Lr)NrrrrNr)�__name__�
__module__�__qualname__rYrJrMrUr^r�r�r�rrrr/r/:s0���H�!U�D!�
�Y�{�x�Lrr/c��eZdZdZd�Zd�Zy)r�rc�l�||||||f\|_|_|_|_|_|_||_yrr�)rHrBrErCrFrDrGr:s        rrJz%StandardEncryptionDictionary.__init__�s5��@A�2�q�"�a�QV�@V�=�����$�&�$�'�4�6�4�:� ��
rc���ddlm}m}m}|�}|d�t	|j
�t	|j�|jd�}|jdk(r�d|d<d|d<d|d	<t	|j
�|d
<t	|j�|d<t	|j�|d<t	|j�|d
<t	|j�|d<|d�|d<|d�|d<d|d�|d�d�}d||�i}||�|d<n)|jdk(rd|d<d|d<d|d	<n
d|d<d|d	<||�}	|	j|�S)Nr)�DummyDoc�
PDFDictionary�PDFName�Standard)�FilterrBrCrDr5r&�Length�R�VrBrCrErFrG�StdCF�StrF�StmFr"�DocOpen�AESV3)r��	AuthEvent�CFM�CFr3r2rr)
�reportlab.pdfbase.pdfdocr�r�r�rsrBrCrDr:rErFrG�format)
rHr{r�r�r��dummy�dict�stdcf�cf�pdfdicts
          rr�z#StandardEncryptionDictionary.format�sg��M�M��
��!�*�-��T�V�V�_��T�V�V�_��V�V����=�=�A�� �D��N��D��I��D��I������D��I������D��I� ����)�D��J� ����)�D��J�#�D�J�J�/�D��M�"�7�+�D��L�"�7�+�D��L��$�Y�/��w�'��E���u�-��B�'�r�*�D��J�
�]�]�a�
� �D��N��D��I��D��I��D��I��D��I���%���~�~�e�$�$rN)r�r�r��__RefOnly__rJr�rrrr�r��s���K�!�&%rr�za
28 BF 4E 5E 4E 75 8A 41 64 00 4E 56 FF FA 01 08
2E 2E 00 B6 D0 68 3E 80 2F 0C A9 FE 64 53 69 7A
c�^�dttt|���j�zS)z'a legitimate way to show strings in PDFz<%s>)r
rr	�upper)�texts rrsrs-s$���H�W�X�d�^�4�5�;�;�=�=�=rc�^�t|ddd�t|ddd�t|dd�S)Nr�<zbad hex text����>r)�
equalityCheckr)rss r�	unHexTextr�1s3���'�!�*�c�>�2��'�"�+�s�N�3��W�Q�r�]�#�#r�c#�FK�|]}tt|d�����y�w)r!N)�chrrq)r�cs  rrr6s����N��S��Q���_�N�s�!c��|�Stj}|dk(rd}|S|dk(rd}|S|dk(rtstd��d}|Stdt	|�z��|S)	Nr1rr2r3r&r4r5r6)rr9r;r<r=)r:rIs  r�
checkRevisionr�8s{�����/�/���r�>��H��O���_��H��O�
��_�� �!d�e�e��H��O��=��X��N�O�O��Orc
��t|�}t|�tz}|dd}|}d}td�D]}|dz}|dz	}|t	|dz�z
}�tt|��}	|	j
t|��|	j
t|��|	j
t|��|	j�}
|dk(r|
dd}n3|d	k(r.td
�D]}t|
�j�}
�|
dd}tr=tdt|||||fD�cgc]}tt|����c}�z�Scc}w)
Nr"rrrdr r&rr5r3�2r!z"encryptionkey(%s,%s,%s,%s,%s)==>%s)
r�r�	PadStringr'rr�updaterorkrl�tuplers�str)
�password�OwnerKey�Permissions�FileId1r:rT�permissionsStringr+�byte�hash�	md5outputr�xs
             rryryGsn���X�&�H�
�x� �9�,�H����}�H��A���
�1�X�2���D���
�q�D���X�d�S�j�1�1��2�
�w�x� �!�D��K�K���!�"��K�K��)�*�+��K�K��� �!����
�I���{����m��	�1���r��	0�A��I��-�-�/�I�	0����n���e�8�5�\d�fn�p{�~E�GO�QT�\U�BV�VW�'�#�a�&�/�BV�<W�W�X��J��BVs�Ec��ddlm}|dvs
Jd|z��|s|}t|�tz}|dd}t|�tz}|dd}t	|�j�}trNtdtt��dt|��dt|��d	t|��d
t|��d|���|dk(r||dd
�j|�}nh|dk(rctd�D]}	t	|�j�}�|dd}|}td�D]%}	t|	|�}
||
�j|�}�'tr;tdt|||fD�cgc]}tt|����c}�z�Scc}w)Nr��ArcIVrizUnknown algorithm revision %sr"z
PadString=z

ownerPad=z

password=z	
userPad=z
digest=z

revision=rr5r3r�r!�zcomputeO(%s,%s,%s)==>%s)�reportlab.lib.arcivr�rr�rrorkrl�asciir^r'rr�rsr�)r7r8r:r��ownerPadr��userPadrorBr+�thisKeyr�s            rrxrxhs���)��u��H�=��H�H���$�
��}�%�	�1�H���"�~�H��|�$�y�0�H��s��m�G�
��]�
!�
!�
#�F��e�di�js�dt�uz�|D�vE�FK�LT�FU�V[�\c�Vd�ej�kq�er�s{�|�}��1�}��&��!�*��$�$�W�-��	�Q���r��	*�A���[�'�'�)�F�	*���������r��	)�A��Q��'�G��g��%�%�a�(�A�	)�
�e�-��Q]�_l�nv�wx�Py�6z�1�w�s�1�v��6z�0{�{�|��H��7{s�E?c
�\�t|�}ddlm}|dk(r||�j|�}n�|dk(r�|�Jd��t	t
�}|j
t|��|j�}||�j|�}tdd�D]%}t||�}	||	�j|�}�'t|�dkr|d	z
}t|�dkr�|}tr<td
t||||fD�
cgc]}
tt!|
����c}
�z�Scc}
w)Nrr�rr3z+Revision 3 algorithm needs the document ID!rr�r"�zcomputeU(%s,%s,%s,%s)==>%s)r�r�r�r^rr�r�r	ror'r�lenrkrlr�rsr�)ry�encodestringr:rjr��result�h�tmpr*r�r�s           rrzrz�s9���X�&�H�)��1�}��}�%�,�,�\�:��	�Q���%�T�'T�T�%��	�N��	����*�%�&��h�h�j���M�"�)�)�#�.���q���	-�A��Q�
�.�G���.�'�'��,�C�	-��#�h��m��5�L�C��#�h��m����e�0�5�Ta�co�px�zD�EK�TL�:M�a�'�#�a�&�/�:M�4N�N�O��M��:Ms�?D)c��t||�}|tk7r1t|�tt�k7rtd��td��y)Nz&lengths don't match! (password failed)z;decode of U doesn't match fixed padstring (password failed))rzr�r�r<)ryrC�decodeds   r�checkUr��sC���}�a�(�G��	���w�<��Y��'��E�F�F��V�W�W�rc
�v�t|�}|dvr�|}|}td�D]}|t|dz�z
}|dz	}�|}td�D]}|t|dz�z
}|dz	}�t|�j	�}|dk(r|dd}n|dk(r|}dd	lm}	|	|�j|�}
n�|d
k(r�td�}tjtj||���}t|�}
d
}|
dkDrd|
dzz
nd|
z
}|dkDrt|�|z}t|t�r||zjd�}n|t!|�z
}||j#|�z}
|
|j#�z
}
t$r=t'dt)|||||
fD�cgc]}t+t|����c}�z�
Scc}w)zEncodes a string or streamrir3rdr rN�
rr�r5r!rbr�zutf-8zencodePDF(%s,%s,%s,%s,%s)==>%s)r�r'rrror�r�r^r-r;rtrur�r��
isinstancer�rrvrkrlr�rs)r�objectNumber�generationNumber�stringr:�newkeyr*r+r�r��	encryptedrcr��
string_len�padding�padding_lenr�s                 rr[r[�s����X�&�H��5�������q��	�A��h�q�4�x�(�(�F��1��A�	�
���q��	�A��h�q�4�x�(�(�F��1��A�	���K�&�&�(�	��q�=��C�R�.�C�
��]��C�-��#�J�%�%�f�-�	�	�Q��
��^���O�O�E�$?�$?���$K�L�	���[�
���2<�r�/�r�Z�"�_�-��Z�����?��+�&��4�G��f�c�"��w�&�.�.�w�7�F��g�g�&�&�F������/�/�	��Y�^�^�%�%�	��e�4�u�X[�]i�k{�~D�FN�OX�XY�>Z�RS�g�c�!�f�o�>Z�8[�[�\����>Zs�F6c�,�||k(sJ|�d|�d|����y)Nz
 expected=z
 observed=r)�observed�expected�labels   rr�r��s���X��Z�%��QY�Z�Z�rc� �tddd��}|jdd��d}d}d	}tt|j�|d
�tt|j
�|d�tt|j�|d�td
dd��}|jdd��d}d}d}tt|j�|d�tt|j
�|d�tt|j�|d�y)N�User�Ownerr1�rIr`)r|zB<FA7F558FACF8205D25A7F1ABFA02629F707AE7B0211A2BB26F5DF4C30F684301>zB<09F26CF46190AF8F93B304AD50C16B615DC43C228C9B2D2EA34951A80617B2B1>z<BB2C00EB3D>z40 bit O valuez40 bit U valuez40 bit key value�userpass�	ownerpassr2zB<68E5704AC779A5F0CD89704406587A52F25BF61CADC56A0F8DB6C4DB0052534D>zB<A9AE45CDE827FE0B7D6536267948836A00000000000000000000000000000000>z"<13DDE7585D9BE366C976DDD56AF541D1>z128 bit O valuez128 bit U valuez
128 key value)r/r�r�rsrBrCr)�enc�	expectedO�	expectedU�expectedKeys    r�testr��s���
�V�G�b�
9�C��K�K��!3�K�4�T�I�T�I� �K��'�#�%�%�.��,<�=��'�#�%�%�.��,<�=��'�#�'�'�"�;�0B�C��Z��c�
B�C��K�K��#5�K�6�T�I�T�I�6�K��'�#�%�%�.�)�->�?��'�#�%�%�.�)�->�?��'�#�'�'�"�K��Arc	�J�t|||||||��}||j_y)z2Applies encryption to the document being generatedr�N)r/�_doc�encrypt)	�canvasr7r8r>r?r@rArIr�s	         r�
encryptCanvasr��s,���\�=�%�y�'�;�&.�0�C��F�K�K�rc��eZdZdZd�Zd�Zy)�EncryptionFlowablez�Drop this in your Platypus story and it will set up the encryption options.

    If you do it multiple times, the last one before saving will win.c��y)N)rrr)rH�
availWidth�availHeights   r�wrapzEncryptionFlowable.wraps��rc	��t|j|j|j|j|j
|j|j�yr)r��canvr7r8r>r?r@rAr�s r�drawzEncryptionFlowable.draw	s@���d�i�i��'�'��(�(��m�m��n�n��l�l��&�&�
	(rN)r�r�r��__doc__rrrrrr�r�s��I��(rr�c��td��)z*For use in Platypus.  Call before build().zNot implemented yet)�	Exception)�dtr7r8r>r?r@rArIs        r�encryptDocTemplater	s��
�)�
*�*rc
���	ddlm}m}	||dd��\}
}t	|
j��}|
ddd}
t
�}t||
�	�}trd
|j_
|	||�}|D]:}|j|
|dd�|j|�|j��<t||||||||��|j�|j!�S#t$rtd��wxYw)aaccepts a PDF file 'as a byte array in memory'; return encrypted one.

    This is a high level convenience and does not touch the hard disk in any way.
    If you are encrypting the same file over and over again, it's better to use
    pageCatcher and cache the results.r)�storeFormsInMemory�restoreFormsInMemoryz~reportlab.lib.pdfencrypt.encryptPdfInMemory failed because rlextra cannot be imported.
See https://www.reportlab.com/downloadsr)�all�BBoxes�
PageForms0rN)�pagesizez&[(xxxxxxxxxxxxxxxx)(xxxxxxxxxxxxxxxx)]r�)�rlextra.pageCatcher.pageCatcherrr�ImportError�list�keysrrrpr��_ID�setPageSize�doForm�showPager��save�getvalue)�inputPDFr7r8r>r?r@rArIrr�bboxInfo�pickledForms�names�
firstPageSize�bufr�	formNames�formNames                  r�encryptPdfInMemoryr#s��,�\�
 2�(��!�L��X�|������!�E��\�*�1�2�.�M��)�C��#�
�.�D��@��	�	�
�$�\�4�8�I��������(�+�A�B�/�0����H���
�
����$��
��I�w��#�%�	�I�I�K��<�<�>���7�,��+�,�	,�,�s�C"�"C7c	
��t|d�j�}	t|	|||||||��}
t|d�j|
�t	|
�S)z>Creates encrypted file OUTPUTFILENAME.  Returns size in bytes.�rbr��wb)�open�readr#�writer�)�
inputFileName�outputFileNamer7r8r>r?r@rArIr�	outputPDFs           r�encryptPdfOnDiskr-EsW���M�4�(�-�-�/�H�"�8��
��I�w��,4�6�I�	����$�$�Y�/��y�>�rc�`�tjdd}d}gd�}d}d}d}d}d}d}d}	|d}
t|�dd}t|�dkD�rC|ddk(s|ddk(rt	|�yt|�d	krtd
��|d|vr7|d}|dd}tjj|�std|z��td��d
}
dD]$\}}|D]}||vs�|}
|j|���&d|vsd|vrjd|vr|jd�}d}nd|vr|jd�}d}	t|dz�}|j|dz�|j�nddlm
}dd|dfdd|dfdd|dfdd|dfdd|dfdd|dfdd|d fd!d|d fd"d#|d$fd%d#|d$fd&d'|d(fd)d'|d(fd*d+|	d,fd-d+|	d,ff}d.}|D]�}|d|vs�|j|d�}|d|vr||dzd/vrtd0|dz��	||dz|vr�|d|vrt|dd1zt��nt|dd2zt��|rt	|d3�d4||dz�d5��|j||dz�|j|d���|d7kDr�t	d8|�t	d9|
�t	d:|	�t	d;|�t	d<|�t	d=|�t	d>|�t	d?|�t	d@|�t	d:|	�t	dA|�|	dk(r|dBddCk(s|dBddDk(r|ddB}n|}|dEz}	t!||	|||||||
�F�	}|rt	dG|	�dH|�dI|�dJ|�dK�	�t|�dkDrtdLt#|�ddM�dN|����yt	|�y#d}Y��dxYw#d6|d3z�xYw)ONanPDFENCRYPT USAGE:

PdfEncrypt encrypts your PDF files.

Line mode usage:

% pdfencrypt.exe pdffile [-o ownerpassword] | [owner ownerpassword],
	[-u userpassword] | [user userpassword],
	[-p 1|0] | [printable 1|0],
	[-m 1|0] | [modifiable 1|0],
	[-c 1|0] | [copypastable 1|0],
	[-a 1|0] | [annotatable 1|0],
	[-s savefilename] | [savefile savefilename],
	[-v 1|0] | [verbose 1|0],
	[-e128], [encrypt128],
	[-h] | [help]

-o or owner set the owner password.
-u or user set the user password.
-p or printable set the printable attribute (must be 1 or 0).
-m or modifiable sets the modifiable attribute (must be 1 or 0).
-c or copypastable sets the copypastable attribute (must be 1 or 0).
-a or annotatable sets the annotatable attribute (must be 1 or 0).
-s or savefile sets the name for the output PDF file
-v or verbose prints useful output to the screen.
      (this defaults to 'pdffile_encrypted.pdf').
'-e128' or 'encrypt128' allows you to use 128 bit encryption (in beta).
'-e256' or 'encrypt256' allows you to use 256 bit encryption (in beta AES).

-h or help prints this message.

See PdfEncryptIntro.pdf for more information.
)�-o�owner�-u�user�-prO�-mrP�-crQ�-arR�-s�savefile�-v�verbose�-h�help�-e128�
encrypt128�-e256�
encryptAESr�rz
encrypted.pdfrr;r<rz2Must include a filename and one or more arguments!zCan't open input file '%s'!z2First argument must be name of the PDF input file!r1))r2)r=r>)r&)r?�
encrypt256r9r:)r:r/�OWNERzOwner passwordr0r1�USERz
User passwordr2r3�	PRINTABLEz'Printable'rOr4�
MODIFIABLEz'Modifiable'rPr5�COPYPASTABLEz'Copypastable'rQr6�ANNOTATABLEz
'Annotatable'rRr7�SAVEFILEzOutput filer8)r3rOr4rPrQr5rRr6)�1�0z#%s value must be either '1' or '0'!z = int(argv[pos+1])z = argv[pos+1]r3z
 set to: 'z'.zUnable to set %s.rz
infile:z	STRENGTH:z	SAVEFILE:zUSER:zOWNER:z
PRINTABLE:zMODIFIABLE:z
COPYPASTABLE:zANNOTATABLE:zVERBOSE:���z.pdfz.PDFz_encrypted.pdfr�zwrote output file 'z'(z bytes)
  owner password is 'z'
  user password is '�'z
Unrecognised arguments : r�z
known arguments are:
)�sys�argvrr�rlr<�os�path�isfile�remove�indexrq�reportlab.rl_configr:�exec�varsr-r�)�sys_argv�usage�known_modesrBrCrDrErFrGrH�callerrN�infile�STRENGTH�s�_arg�pos�argr:�arglist�binaryrequired�thisarg�tinfile�filesizes                         r�scriptInterprfTs����x�x��{�H� 
�E�D�K��E��D��I��J��L��K�"�H��a�[�F���>�!�"��D�
�4�y��{���7�d�?�d�1�g��/��%�L���t�9�Q�;��Q�R�R���7�+�%��!�W�F����8�D��7�7�>�>�&�)� �!>��!G�H�H��Q�R�R���Q�	#�F�Q�r��
#����9� �H��K�K��N�
#�	#�
�D�L�i�4�/��t�|��j�j��&�����d�"��j�j��+����
��d�3�q�5�k�*��
�K�K��S��U��$��K�K���3��'�5�*:�;��W�e�-=�>��&�$��8��F�D�/�:��+�y�-�@���i��G��,�
�N�C� �,��^�L��.�,�8H�I�"�N�L�BR�S��-��o�F�!�=�+��O��*�h�
�>��
�H�m�D��� l���	;�G��q�z�T�!��j�j����,���1�:��/��C��E�{�*�4�(�)N�QX�YZ�Q[�)[�\�\�;��C��E�{�+�5�"�1�:��7� ����-B�!B�4�6�J� ����-=�!=�d�f�E�"�!���
�D��Q��K�"P�Q����D��Q��K�0����G�A�J�/��	;�&�1�9��+�v�&��+�x�(��+�x�(��'�4� ��(�E�"��,�	�*��-��,��/�<�0��.�+�.��+�x�(��*�g�&���&��b�c�{�f�$��r�s��v�(=� ��"�+�� ���/�/�H�#�F�H�d�E��Z��{�-5�7����ks�u}�@E�GK�L�
M��t�9�Q�;��Z]�^b�Zc�de�fh�Zi�kv�w�x�x��	�e���[
����R;�-���
�:�:�s�+N�9B
N#�N �#
N-c��t�yr)rfrrr�mainrh�s���Nr�__main__�z--debugz--testr)Nrrrrr1)I�__version__rMrO�binasciirr�hashlibr�ior�reportlab.lib.utilsrrr	r
�reportlab.pdfgen.canvasrr�r�reportlab.platypus.flowablesr
�	reportlabrr;rrrrprr�debugrk�	reserved1�	reserved2rOrPrQrRrSr'r+�	invariantr)r(r-�urandomr/r�r�rsr��join�strip�splitr�r�ryrxrzr�r[r�r�r�r�r	r#r-rfrhr�rNrgr�)r�s0r�<module>r{s@��
��+��'���E�E�*�.�1�����%�
�	�������
�	��	��	�
�
�����
�
�	�q���%�A��q�!�t�$�J�%�
����L�|�L�����J�~L�~L�@+%�9�+%�\��
>�$�

�R�W�W�N�g�m�m�o�6K�6K�6M�N�N�O�	�
��B
�8*3�D�D��(X�,�\[�B�@/3�BC��	�(�+�X�(�(/3�BC� "�+�/3�BC� "�'�T/3�BC� ��i�V��Z���H�H�1�q��"�1��y� 0��1�A��"�x�x�<�!�1�R�a�5�)�+;�A�<����A����3�8�8��T�V�
�&�
��]���E���^	2��<s*�
G�
G�*G�
G�G�G
�G


Zerion Mini Shell 1.0