Skip to content

Latest commit

 

History

History
92 lines (53 loc) · 1.75 KB

File metadata and controls

92 lines (53 loc) · 1.75 KB

������

IDEA - IDEA�����㏍����壩���垩�吾��Perl��ゃ�潟�帥�若����с�若�

网�荀�

use Crypt::IDEA;

茯㋛�

������perl��≦宍���IDEA�����㏍����壩���垩�≪�˨�眼�ŝ�冴����勐��茖���с����� ��≪�吾�ャ�若�˨��Crypt::BlockCipher��ゃ�潟�帥�若����с�若�鴻��絎�茖�������篁ヤ����勉�<�純�������� �����<�障�����

blocksize =item keysize =item encrypt =item decrypt

��∽�

blocksize

����垩����㏍����壔�勐ぇ������(�����ゃ�����)���菴������障�����

keysize

��㏍�若�泣�ゃ��(�����ゃ�����)���菴������障�����

new
my $cipher = new IDEA $key;

$key���篏帥�c�⓾����違�����IDEA BlockCipher��ŝ����吾�с�壔�����篏���������障����� $key��勉����������˨��keysize()�����ゃ����勉�㏍�若�˨�ŝ����障�����

encrypt
my $cipher = new IDEA $key;
my $ciphertext = $cipher->encrypt($plaintext);

�����勰�∽�違��$plaintext�������垸��������$ciphertext���菴������障����� $plaintext���$ciphertext���blocksize()�����ゃ����˨�ŝ����壔����с�����

decrypt
my $cipher = new IDEA $key;
my $plaintext = $cipher->decrypt($ciphertext);

�����勰�∽�違��$ciphertext���緇ï垸��������$plaintext���菴������障����� $plaintext���$ciphertext���blocksize()�����ゃ����˨�ŝ����壔����с�����

篏睡��箴�

my $key = pack("H32", "0123456789ABCDEF0123456789ABCDEF");
my $cipher = new IDEA $key;
my $ciphertext = $cipher->encrypt("plaintex");  # NB - 8�����ゃ��
print unpack("H16", $ciphertext), "\n";

������莖����

Crypt::DES

Bruce Schneier, Applied Cryptography, 1995, Second Edition, published by John Wiley & Sons, Inc.

���篏�罔�(COPYRIGHT)

This implementation is copyright Systemics Ltd ( http://www.systemics.com/ ).

The IDEA algorithm is patented in Europe and the United States by Ascom-Tech AG.

Module altered on 22 May 1999 to allow functionality with perl -MCPAN, Changes by Dave Paris (edited lib paths).

膺肢┳���

綏����絖���� (GCD00051@nifty.ne.jp)