Mobinex
asked on
How to work with JAVA crypto to encrypt a file/ a string
Hi Experts,
I am work on crypto to encrypt file and string,
I know java has supported crypto API but I don't know details about this and how to use
Can you help me to give some suggestion/examble that is using JAVA crypto to encrypt/decrypt a file and a string with DES-EDE2 or others
Thanks in advance
I am work on crypto to encrypt file and string,
I know java has supported crypto API but I don't know details about this and how to use
Can you help me to give some suggestion/examble that is using JAVA crypto to encrypt/decrypt a file and a string with DES-EDE2 or others
Thanks in advance
See http://www.exampledepot.com/egs/javax.crypto/PassKey.html and related examples
ASKER
Thank for all help,
I will try to work with http://www.exampledepot.com/egs/javax.crypto
For http://www.devx.com/Java/10MinuteSolution/21385/1954?pf=true I knew this, but it can not descrypt my string that I encrypt from other crypto library.
Can you all help again with below question:
String encryptedString = "880BF4E4946B940423B478A1F 46FF79A89A 20737EEDA6 52562C4FC4 3CAF0B1CF0 A2818A5649 969E3BA5C0 A447B2C8E6 A7CD5159CD 2FB738275F B09A230470 45EEC51F23 7F423B80BB 6BD9DEC4B1 957C9947DC B19FD7C8D9 0B815F3162 F728F618CE F619196C8B EF3CEE459F EB5F881659 6F35645EFE 40B4CD9B1D FEFF529E81 DDD4E8C6CD 253F95800B 97F001F740 CC486E7918 B2AD08D14F 9F9CC312CC CB1586173B F920D9476A 6156F7AC03 B03D3BC8C1 548FACEB9B 81C96A5600 E6A8A0A987 BAAF1033B6 3453FE8BDE 2A5077E945 9FBE55011E 307889A5A8 3802C48925 169C2E7052 9EC81FD42B 0E5E62F95E 8D966A5FE4 6A05C2A0D4 B564F47478 864C7B743E 136A64C000 630CC4A746 58FD1DB560 755C53C204 EAAB56149E C3A90C592D 290DD41D7E 316EC13713 E1D80601AB F6CA0B79BA 4DC113013C 1C502AA316 6C20D98EF4 F63855FD12 D03CFAFE48 C07164D7CC C63A681E64 D581EC975A 2C5324E2C1 ED17161F42 9529CC4735 F2CA46E148 AD6BAB1905 6678433391 EAE57165C5 3499580253 6F34F23B2E DEAD012D90 0D919C000C A73CC5912A C183B24B8D 1B4AD99E8B CB42FCCE59 296D94CB6C 3203AA9F31 D81955D1D5 E2C03A6D8D A939976107 9459C3B434 9CAE811C07 61ED3A7566 00C342B0E7 05FF1A8A2E 6601A656E1 35569";
Can you know what Encryption Scheme/Crypto Algorithm Name? (this string is encrypted from crypto C++ library version 5.0 using DefaultCrypto)
I used http://www.devx.com/Java/10MinuteSolution/21385/1954?pf=true to decrypt with DES, DES-EDE2 but it has problem with block invalide (javax.crypto.BadPaddingEx ception)
Many thank again.
I will try to work with http://www.exampledepot.com/egs/javax.crypto
For http://www.devx.com/Java/10MinuteSolution/21385/1954?pf=true I knew this, but it can not descrypt my string that I encrypt from other crypto library.
Can you all help again with below question:
String encryptedString = "880BF4E4946B940423B478A1F
Can you know what Encryption Scheme/Crypto Algorithm Name? (this string is encrypted from crypto C++ library version 5.0 using DefaultCrypto)
I used http://www.devx.com/Java/10MinuteSolution/21385/1954?pf=true to decrypt with DES, DES-EDE2 but it has problem with block invalide (javax.crypto.BadPaddingEx
Many thank again.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Can you help to write java program that use crypto encrypt/descrypt library to descrypt below string:
String encrypted ="36102D92CF26C8688140F244 3DBE332099 8197DB0C14 1FC38008FB DD69D70BB4 049490F102 6F2002BA36 12D34D9F59 A9A7CCA487 654EF12EDA B1841D5232 71CB71B3EB B837BE405B FE1CFADE6C 3388AF90CD 58BBB55CAF C06CCE5DDB 5AC364B5DE AE42EE7117 28CE67023D 3D9E033CBC F3C955BA30 5922972B7D C6B22234E5 D2C3A7CD63 0CC4784454 E863E19F2B BA0CBBCC35 DB2F250D0B AFB91B2DE7 17213546C7 737A322374 E65D6FA1FF F12A4D149D EACDD64D76 50268A0680 FB0A0257F7 6A899CE0C4 52DCD3A224 A97FB7690B 7E68D5FFDF 5768B04EA9 70B4EAF5F4 589571E79A 23EA2B7B43 39BC41A017 7B31A8D061 875D7A987A D95EF1DC88 66346196E8 E5E8AEBCBD F3AD";
with key is: String key ="TEST";
String encrypted ="36102D92CF26C8688140F244
with key is: String key ="TEST";
ASKER
Hi Experts
Do you know how to use crypto for JAVA and C++, I mean I need to use JAVA program to encrypt and C++ to descypt.
As I know crypto in C++ we can use crypto++ library, and for Java we have crypto library too.
But I don't know how to use compatible between C++ and JAVA.
Can you let me know some suggestion?
Thank in advance!