Solved

Encrypt RDP password using CryptProtectData in C#

Posted on 2011-09-20
4
1,239 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
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!
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

770 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