Solved

Encrypt RDP password using CryptProtectData in C#

Posted on 2011-09-20
4
1,182 Views
Last Modified: 2012-12-23
Hiya,

First off let me say I have looked at a few solutions for this online and none of them work with the latest release of the RDP client, 6.1.7601

Now, I own a VPS company and I routinely have to log in via RDP to my clients servers, which means typing the username and password over and over, so I have started creating RDP files  with the remote desktop client instead. Inside these files (text files with a .rdp extension) there are 2 lines that set the authentication info, like this:


username:s:Administrator
password 51:b:AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAsgA4Zq9Ml062ejDZ3v2V/wAAAAAQAAAATQB5ACAARABhAHQAYQAAABBmAABAAQAAIAAAAM57rLzz5ZBdY8P8T/aT78cUpP+O93qSjMgUNsHJlyaPAAAAAA6AAAAAAgAAIAAAAPTq6R6HlzhFEmax2ibY/4FrkHQSv0XzDh70KIfcwCptEAAAAHVnnilRDPkwp4JlZ3hQ7/FAAAAA25GnEDwK9Q827n4Be7lZiQNTGNEyBKOdFaU9Z0kY8lSWcH/SUiEbn1lB+IO0cgZkJitCgFOQuGbmKY34lOAjTg==

The password is, so I understand, encrypted with CryptProtectData, but I cannot get it to work. The encrypted strings I come up with do not match up at all - like they are a different algorithm. That said, the examples I have used to base my code off are very old - it may be that version 6 no longer uses CryptProtectData or that some other variable has changed.

I do NOT need to decrypt... only encrypt. I would like to generate an application that will create a DRP connection for me on the fly from my database, so if the user changes his/her password, I can click a button to create a new RDP file that I can use to connect without typing user/pass.

Hope that makes sense... its been a very long day and am dead tired. If anyone knows how to do this for RDP 6+, please let me know.

Thanks much,

Dave
0
Comment
  • 3
4 Comments
 
LVL 13

Expert Comment

by:jonnidip
ID: 36590119
You may find this project useful for your needs: terminals (you can get the source too).
There is a commercial product I use at work: RoyalTS.

Regards.
0
 

Author Comment

by:SimplePaymentSolutions
ID: 36591336
Thanks for the look, but neither of those have anything to do with encrypting the RDP password. If either would do that, then either would work... but I need either the solution for the problem explained above, or a client like the ones you linked that will allow a database feed that contains the user/pass to use for the connections. that said, I may take a  look at RoyalTS just to make things simpler for me, but I will still need the solution to this problem as well.
0
 

Accepted Solution

by:
SimplePaymentSolutions earned 0 total points
ID: 38704570
I ended up going with Remote Desktop Manager, Enterprise version for this. The owner/dev of that software added a special feature for me to import from excel file (which I automated the creation of out of our database.)
0
 

Author Closing Comment

by:SimplePaymentSolutions
ID: 38716815
There were no other answers, and I need to close the question in order to post another.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This video discusses moving either the default database or any database to a new volume.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now