
Triple DES Decryption in Java
- or -
Post a project like this1949
£100(approx. $133)
- Posted:
- Proposals: 9
- Remote
- #2636761
- Awarded
WEBSITE DEVELOPMENT & DESIGN ! WORDPRESS ! JAVA ! PHP ! JAVASCRIPT ! GRAPHIC DESIGN | VIDEO | EXCEL VBA & MACRO EXPERT

software engineer|Full-Stack Software Developer| web developer| App developer | AI Engineer | WordPress
195247625610661244165268783830911063352647284115128736113427171





Description
Experience Level: Entry
I require a Java class containing a method that recieves an encrypted string and returns the decrypted string.
The encrypted string will be text from an XML file that has been encrypted with the Triple DES algorithm via the CBC mode.
The decryption requires both a key and salt, which I have. The following is an example of this method in C#:
public string decrypt(string text, string password, string salt) {
DeriveBytes rgb = new Rfc2898DeriveBytes(password, Encoding.Unicode.GetBytes(salt));
_algorithm.Mode = CipherMode.CBC;
byte[] rgbKey = rgb.GetBytes(_algorithm.KeySize >> 3);
byte[] rgbIV = rgb.GetBytes(_algorithm.BlockSize >> 3);
ICryptoTransform transform = _algorithm.CreateDecryptor(rgbKey, rgbIV);
using (MemoryStream buffer = new MemoryStream(Convert.FromBase64String(text))) {
using (CryptoStream stream = new CryptoStream(buffer, transform, CryptoStreamMode.Read)) {
using (StreamReader reader = new StreamReader(stream, Encoding.Unicode)) {
return reader.ReadToEnd();
}
}
}
}
The encrypted string will be text from an XML file that has been encrypted with the Triple DES algorithm via the CBC mode.
The decryption requires both a key and salt, which I have. The following is an example of this method in C#:
public string decrypt(string text, string password, string salt) {
DeriveBytes rgb = new Rfc2898DeriveBytes(password, Encoding.Unicode.GetBytes(salt));
_algorithm.Mode = CipherMode.CBC;
byte[] rgbKey = rgb.GetBytes(_algorithm.KeySize >> 3);
byte[] rgbIV = rgb.GetBytes(_algorithm.BlockSize >> 3);
ICryptoTransform transform = _algorithm.CreateDecryptor(rgbKey, rgbIV);
using (MemoryStream buffer = new MemoryStream(Convert.FromBase64String(text))) {
using (CryptoStream stream = new CryptoStream(buffer, transform, CryptoStreamMode.Read)) {
using (StreamReader reader = new StreamReader(stream, Encoding.Unicode)) {
return reader.ReadToEnd();
}
}
}
}

Jasper H.
100% (1)Projects Completed
1
Freelancers worked with
1
Projects awarded
100%
Last project
9 Dec 2019
United Kingdom
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
Please provide the sample data for me to test the program.
When you want the program to be completed?
873346
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies