RE: [Botan-devel] TripleDES /ECB Mode
Brought to you by:
randombit
|
From: JnMlMe <jn...@fr...> - 2004-09-08 15:41:52
|
HI,
I m working now on solaris 2.6 / gcc 2.95.3
I have an error during the compilation:
=20
=20
[xxx@solaris2.6]> make
g++ -m32 -mno-app-regs -Iinclude/ -O2 -finline-functions -mcpu=3Dv8
-Wa,-xarch=3Dv8plus -ansi -Wno-long-long -W -Wall -fPIC -c src/conf.cpp =
-o
build/lib/conf.o
/usr/ccs/bin/as: "/var/tmp/ccsqSuwc.s", line 6280: error: can't compute
value of an expression involving an external symbol
make: *** [build/lib/conf.o] Error 1
=20
Anybody have an idea ?
Thks
=20
=20
=20
-----Message d'origine-----
De : ope...@li...
[mailto:ope...@li...] De la part de Jack =
Lloyd
Envoy=E9 : mardi 7 septembre 2004 03:28
=C0 : ope...@li...
Objet : Re: [Botan-devel] TripleDES /ECB Mode
=20
On Mon, Sep 06, 2004 at 03:46:52PM +0200, JnMlMe wrote:
> Hi,
>=20
> I need to decrypt a string who was encrypted with Triple DES (ECB =
Mode)
> under SUN Solaris.
>=20
> First, I would like to compile Botan under Windows 2K environment.
> I have a problem when i process the nmake command :
>=20
> =20
>=20
> D:\botan>perl configure.pl msvc-windows-i586 --module-set=3Dwin32
[...]
>=20
> CL /nologo -Iinclude /O2 /G5 /GX /GR /D_CONSOLE /c
src\adler32.cpp
> /Fob
> uild\lib\adler32.obj
> 'CL' n'est pas reconnu en tant que commande interne
> ou externe, un programme ex=E9cutable ou un fichier de commandes.
> NMAKE : fatal error U1077: 'CL' : return code '0x1'
> Stop.
=20
It looks like cl, the command line version of the compiler, isn't in =
your
PATH
variable. Have you tried using the command shell that comes with Visual
Studio?
Running that will automatically set up your environment with the right
variables for using the compiler and linker from the command line. =
Otherwise
you'll have to find where the CL binary is installed, and add that =
directory
to
PATH.
=20
> Second point, i have looked the encrypt and decrypt cpp examples =
files.
>=20
> These files used the CBC mode.
> Should i only changed the mode with ECB in line 117 ?
>=20
=20
No -- the examples are doing password hashing, message authentication, =
and
similiar things that you probably don't want to do. Well, you do want to =
do
them normally, for decent security, but in this case you won't be able =
to
decrypt the message trying to use them, so there is not much point.
=20
The following should start you off, but I don't know how the key is =
derived,
so
as-is it won't work (because currently the key is zero-length, which =
3DES
doesn't take). If you know the hex value of the key, just assign it to =
the
key variable (SymmetricKey key =3D "01234[...]").
=20
----- FILE ------
=20
#include <botan/botan.h>
using namespace Botan;
=20
int main(int argc, char* argv[])
{
try {
if(argc !=3D 2)
{
std::cout << "Usage: " << argv[0] << " input_file" << =
std::endl;
return 1;
}
=20
LibraryInitializer init;
=20
SymmetricKey key; // fill this in with whatever key you have
=20
Pipe pipe(get_cipher("TripleDES/ECB/NoPadding", key, DECRYPTION));
=20
DataSource_Stream input(argv[1]);
pipe.process_msg(input);
std::cout << pipe.read_all_as_string();
}
catch(std::exception& e)
{
std::cout << "Error: " << e.what() << std::endl;
return 1;
}
return 0;
}
=20
----- /FILE ------
=20
=20
-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=3D5047&alloc_id=3D10808&op=3Dclick
--=20
opencl-devel mailing list
https://lists.sourceforge.net/lists/listinfo/opencl-devel
____________
Virus checked by G DATA AntiVirusKit
Version: BD 14.0.534 from 04.09.2004
Virus news: www.antiviruslab.com
|