× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



IBMiOSS doesn't support C#. It might be theoretically possible to run C#, but probably not practical.

My advice would be:
1. What encryption does it use?
2. How can you do that encryption on IBMi 7.1?




-----Original Message-----
From: Dan [mailto:dan27649@xxxxxxxxx]
Sent: Monday, November 13, 2017 4:20 PM
To: IBMi Open Source Roundtable <opensource@xxxxxxxxxxxx>
Subject: [IBMiOSS] C# decryption port to Power i

I have a requirement to accept an encrypted credit card number from our Oracle system, decrypt it on our Power i so that we can then send it to Curbstone for payment processing.

Our Oracle developer gave me the following C# code that will decrypt the data.


private byte[] SALT = Encoding.Unicode.GetBytes("<32 bytes removed>";



public string decryptText(string encText, string password)

{

byte[] cipher = Convert.FromBase64String(encText);
Rfc2898DeriveBytes bytes = new Rfc2898DeriveBytes(password, SALT),
1000); Rijndael rijndael = Rijndael.Create();

rijndael.BlockSize = 256;

rijndael.Key = bytes.GetBytes(32);

rijndael.IV = bytes.GetBytes(32);
MemoryStream memoryStream = new MemoryStream();

CryptoStream chiperStream = new CryptoStream(memoryStream, rijndael.CreateDecryptor(), CryptoStreamMode.Write);

chiperStream.Write(cipher, 0, cipher.Length);

chiperStream.Close();



return Encoding.Unicode.GetString(memoryStream.ToArray());

}

We are on v7r1, cume C6320710 (level 16320), TR level 11. SF99123 level 3.
Display Installed Licensed Programs does not show 5733OPS installed; the only 5733* LPs I see are:
Licensed Installed
Program Status Description
5733SC1 *INSTALLED IBM Portable Utilities for i
5733SC1 *INSTALLED OpenSSH, OpenSSL, zlib
5733W60 *INSTALLED WebSphere Application Server for OS/400 V6
5733W60 *INSTALLED WebSphere Application Server V6 Express

Is C# supported in the IBM OSS? If not, is the code posted above easily portable to a language that IBM OSS does support? I guess I'll ask the stupid question, is this something that could be accomplished in RPG, using QC2LE functions or any other system supplied functions? FYI, we are moving to v7r3 eventually, but this solution is required long before that will happen.

- Dan


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.