web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Encryption & digitally signing text files in D365FO hosted on cloud and sending via SFTP

(0) ShareShare
ReportReport
Posted on by

Hello everyone,

We have a problem statement of sending encrypted files & digitally signed with pgp keys files to SFTP from Dynamics 365 for operations . We don't have any on premise server and entirely hosted on cloud . Now we are trying to encrypt files using PGP keys but not able to as that software or signing is hosted on Dev VM now but not be available during Production. 

Here is my analysis : 
1. Using GPA interface where in manually we need to select a file and use the option sign and encrypt. So this option will not work for us as all the files will be moved to SFTP automatically where no manual intervention applied.
2. Create a Bat file and use the command prompt manually to execute the Bat for the particular file. This option also can’t be achieved if we don’t have on premise server as we need to place this Bat file to execute it.

Can someone suggest how to proceed on encryption and signing the files with pgp keys for payload security .

Regards,

Smit Patel

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    D365fO has excellent capabilities to integrate third party DLLs or you could build your own code in Visual Studio youself.

    https://community.dynamics.com/ax/b/newdynamicsax/archive/2017/01/20/manage-your-references-to-net-assemblies-dynamics-365-for-operations-vs-projects

    We did AES Ridjndael implementation for encrypting our passwords and sensitive data. Also we have created an FTP wrapper in C# and just use that for uploading our master data and inventory levels to a custom solution provider who does master planning for us outside of AX.

    Have a look at this, or pretty much any C# implementation of PGP signatures:

    stackoverflow.com/.../how-to-digitally-signed-a-text-file-using-pgp-mechanism

    You just need to give specifications/requirements to your developer, let him work on it for a couple of days, and then it should be available for use.

  • geminikartik Profile Picture
    241 on at

    Hi Vilmos,

    We don't have any middleware to run this process of encryption and digitally signing from Cloud VM. Where I can host my PGP application for signing the file and for encryption can you provide some blog using pgp key encryption ?

    Regards

    Kartik Gupta

  • Martin Dráb Profile Picture
    237,959 Most Valuable Professional on at

    The application to run your logic is Dynamics 365 for Operations itself; you don't need any middleware (unless you have some extra requirements that you didn't mention).

    What do you mean by "some blog using pgp key encryption"? Did you check the StackOverflow thread linked above?

  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    My goal was to point you in a direction and confirm that this is indeed possible. I will not be able to provide an exact solution, you need to come up with your own design and implementation as per your requirements.

    I have no idea why would you need a middletier when you can place all logic in AX, again, using DLLs.

    All that you need for the implementation has already been linked earlier.

  • geminikartik Profile Picture
    241 on at

    Hi Martin,

    I checked the stackoverflow blog which states for signing the file using pgp keys . But My question is where to host that GPA application / winscp from where you are generating your keys and storing it. For Prod scenario , there won't be any VM nor we have procured any middle ware server to host application . As I mentioned in earlier post  , we are generating vendor payment files and sending to bank SFTP . Now requirement is to sent these files with encryption with SSH key & files should be signed as well .

    Now we are facing challenge in file encryption itself using ssh key . The generated keys from above mentioned appl needs to keep in particular folder and code should read them

    Regards

    Kartik Gupta

  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    Nothing stops you from putting the Visual Studio C# Project inside AX, and calling it from there, that is why we do not understand why do you want a middleware. They suggest using specific VS libraries for doing the encryption itself, I do not see any requirements for middleware. If the library wants to use files, pick a different library where you can feed keys as string, which for example you could store in an AX table.

  • geminikartik Profile Picture
    241 on at

    Hi Vilmos,

    Let me try out C# code to feed keys from AX table . I hope this will help . Will update my finding soon .

    Thanks for inputs.

    Regards

    Kartik

  • geminikartik Profile Picture
    241 on at

    Hi Vilmos

    I was trying to implement what you have mentioned but below are my queries. If you could answer it would be really helpful for me .

    1)How to keep the pgp key file in db table . For that we need to get the stream of that file                        

    and convert into blob image so as to store that in ax field. So how to convert from stream                        

    to blob image or how to store it to string field .

    Regards

    Kartik                      

  • geminikartik Profile Picture
    241 on at

    Hi Martin ,

    Per your suggestion , I am able to do encryption & signing the file but i have posted few more queries now. Please take a look .

  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    Binary data can be stored in many ways, there are a lot of conversion classes available in C# which you could use in AX as well by accessing them through the System. namespace. The way I would probably do is to store it in base64, or as a hexadecimal string. You can look up these conversions using a search engine and get a lot of solutions back.

    https://msdn.microsoft.com/en-us/library/dhx0d524(v=vs.110).aspx

    We typically store binary files such as images and encryption keys in base64 within our AX 2012 environment.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans