Problem:
There are proprietary algorithms that developers who are actively working on a project will need to call but they should not see the underlying logic. They need to be stored in an area of Source Control that a limited number of developers have access to. The base application will handle user input, data access, and communication with proprietary algorithms when necessary. The proprietary algorithms need to have their logic hidden so if they are included as a reference library then they will need to be obfuscated.
Environment:
- Visual Studio 2022
- BitBucket
- Jenkins
- Windows Server/IIS
Requirements:
- Proprietary Algorithms are stored and maintained in a separate secure Source Control repository
- Any references to the algorithms should hide the underlying logic. A DLL reference would need to be obfuscated first
- Proprietary Algorithms may need to be modified and included as a part of software releases
Solutions:
I'm open to other solutions, but below is what I've been able to come up with so far. Hoping others can provide recommendations between the two approaches or provide additional solutions.
- Compiled Library Reference
- Create a separate secure source control project.
- This project will have its own branching structure.
- It is only included in the project as a compiled reference that has gone through an obfuscation process.
- I'm personally not familiar but believe there are ways to include this in the build process so it will compile the other repository and apply any obfuscation. This can get complicated though as depending on development, we may need to include a specific branch that has the features being worked on.
- I've seen that it's still possible to reverse engineer obfuscated code so it would not be 100% secure.
- Seperate APIs
- Create a separate secure source control repository
- This project will have its own branching structure
- API's will be deployed as their own site.
- The base/main application will access the API's by making REST calls providing the necessary input that the API's need to perform any logic. The API's will not handle data access.
- I like the clear separation in this approach and that it removes the need for obfuscation and makes the build process less complicated.
- It will require the API's to be hosted separately and developers to know which API site they should be calling for the project they're working on. However, this logic will not be changing as frequently as the rest of the application so it's likely that we could have many releases that use the same API version.
- The APIs and application can be hosted on the same server so though it would add additional overhead to make the requests, I don't anticipate it being much of a performance impact.
- Requires more steps in the deployment process whenever the API's also need to be updated
Review
I lean towards the Separate API's architecture as it removes the need for obfuscation, increases the security of proprietary algorithms from reverse engineering (assuming the developers do not have access to the server), reduces complicated build processes that are harder to manage and removes the need for the main developers to understand and update the build process to the correct API's branch for any release. With the proprietary API's being separated, this part of the process is more clear as to who is controlling and deploying it and that team member will know the branch which should be included for any release.
Curious if anyone else has encountered these requirements for code structure and how they accomplished it, as well as thoughts on the above suggestions.