415 </p><dl> |
415 </p><dl> |
416 <dt><i>data</i></dt> |
416 <dt><i>data</i></dt> |
417 <dd> |
417 <dd> |
418 data of size 4 (bytearray) |
418 data of size 4 (bytearray) |
419 </dd> |
419 </dd> |
|
420 </dl><dl> |
|
421 <dt>Returns:</dt> |
|
422 <dd> |
|
423 rotated data (bytearray) |
|
424 </dd> |
420 </dl><a NAME="AES.__shiftRow" ID="AES.__shiftRow"></a> |
425 </dl><a NAME="AES.__shiftRow" ID="AES.__shiftRow"></a> |
421 <h4>AES.__shiftRow</h4> |
426 <h4>AES.__shiftRow</h4> |
422 <b>__shiftRow</b>(<i>state, statePointer, nbr, isInv</i>) |
427 <b>__shiftRow</b>(<i>state, statePointer, nbr, isInv</i>) |
423 <p> |
428 <p> |
424 Private method to shift the bytes of a row to the left. |
429 Private method to shift the bytes of a row to the left. |
499 </dl><dl> |
504 </dl><dl> |
500 <dt>Returns:</dt> |
505 <dt>Returns:</dt> |
501 <dd> |
506 <dd> |
502 decrypted data (bytes) |
507 decrypted data (bytes) |
503 </dd> |
508 </dd> |
|
509 </dl><dl> |
|
510 <dt>Raises <b>ValueError</b>:</dt> |
|
511 <dd> |
|
512 key size is invalid |
|
513 </dd> |
504 </dl><a NAME="AES.encrypt" ID="AES.encrypt"></a> |
514 </dl><a NAME="AES.encrypt" ID="AES.encrypt"></a> |
505 <h4>AES.encrypt</h4> |
515 <h4>AES.encrypt</h4> |
506 <b>encrypt</b>(<i>iput, key, size</i>) |
516 <b>encrypt</b>(<i>iput, key, size</i>) |
507 <p> |
517 <p> |
508 Public method to encrypt a 128 bit input block against the given key |
518 Public method to encrypt a 128 bit input block against the given key |
586 <h4>AESModeOfOperation.decrypt</h4> |
601 <h4>AESModeOfOperation.decrypt</h4> |
587 <b>decrypt</b>(<i>cipherIn, originalsize, mode, key, size, IV</i>) |
602 <b>decrypt</b>(<i>cipherIn, originalsize, mode, key, size, IV</i>) |
588 <p> |
603 <p> |
589 Public method to perform the decryption operation. |
604 Public method to perform the decryption operation. |
590 </p><dl> |
605 </p><dl> |
591 <dt><i>input</i></dt> |
606 <dt><i>cipherIn</i></dt> |
592 <dd> |
607 <dd> |
593 data to be encrypted (bytes) |
608 data to be decrypted (bytes) |
594 </dd><dt><i>originalsize</i></dt> |
609 </dd><dt><i>originalsize</i></dt> |
595 <dd> |
610 <dd> |
596 unencrypted string length (required for CBC) |
611 unencrypted string length (required for CBC) |
597 (integer) |
612 (integer) |
598 </dd><dt><i>mode</i></dt> |
613 </dd><dt><i>mode</i></dt> |
611 </dl><dl> |
626 </dl><dl> |
612 <dt>Returns:</dt> |
627 <dt>Returns:</dt> |
613 <dd> |
628 <dd> |
614 decrypted data (bytes) |
629 decrypted data (bytes) |
615 </dd> |
630 </dd> |
|
631 </dl><dl> |
|
632 <dt>Raises <b>ValueError</b>:</dt> |
|
633 <dd> |
|
634 key size is invalid or decrypted data is invalid |
|
635 </dd> |
616 </dl><a NAME="AESModeOfOperation.encrypt" ID="AESModeOfOperation.encrypt"></a> |
636 </dl><a NAME="AESModeOfOperation.encrypt" ID="AESModeOfOperation.encrypt"></a> |
617 <h4>AESModeOfOperation.encrypt</h4> |
637 <h4>AESModeOfOperation.encrypt</h4> |
618 <b>encrypt</b>(<i>input, mode, key, size, IV</i>) |
638 <b>encrypt</b>(<i>input, mode, key, size, IV</i>) |
619 <p> |
639 <p> |
620 Public method to perform the encryption operation. |
640 Public method to perform the encryption operation. |
638 </dl><dl> |
658 </dl><dl> |
639 <dt>Returns:</dt> |
659 <dt>Returns:</dt> |
640 <dd> |
660 <dd> |
641 tuple with mode of operation, length of the input and |
661 tuple with mode of operation, length of the input and |
642 the encrypted data (integer, integer, bytes) |
662 the encrypted data (integer, integer, bytes) |
|
663 </dd> |
|
664 </dl><dl> |
|
665 <dt>Raises <b>ValueError</b>:</dt> |
|
666 <dd> |
|
667 key size is invalid or decrypted data is invalid |
643 </dd> |
668 </dd> |
644 </dl> |
669 </dl> |
645 <div align="right"><a href="#top">Up</a></div> |
670 <div align="right"><a href="#top">Up</a></div> |
646 <hr /><hr /> |
671 <hr /><hr /> |
647 <a NAME="append_PKCS7_padding" ID="append_PKCS7_padding"></a> |
672 <a NAME="append_PKCS7_padding" ID="append_PKCS7_padding"></a> |