Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

C# - Detect RSA-2048 Encryption on a File

Posted on 2014-12-18
11
Medium Priority
?
683 Views
Last Modified: 2016-10-27
Is there a way to detect, in .NET (C#) whether a file is encrypted using RSA-2048 encryption?
0
Comment
Question by:street9009
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 3
11 Comments
 
LVL 45

Expert Comment

by:AndyAinscow
ID: 40507465
Only if you know the password - then you can successfully decrypt it.
0
 

Author Comment

by:street9009
ID: 40507494
So there's no identifying marks or way to test without knowing the password/key?
0
 
LVL 45

Expert Comment

by:AndyAinscow
ID: 40507513
Not that I know of.
Don't forget, anything that identifies the encryption method is already a help towards decrypting it.
0
2017 Webroot Threat Report

MSPs: Get the facts you need to protect your clients.
The 2017 Webroot Threat Report provides a uniquely insightful global view into the analysis and discoveries made by the Webroot® Threat Intelligence Platform to provide insights on key trends and risks as seen by our users.

 

Author Comment

by:street9009
ID: 40512869
There must be some way, as there appear to be multiple tools that do this: http://security.stackexchange.com/questions/44387/scanning-for-files-than-have-been-encrypted-by-cryptolocker
0
 
LVL 62

Expert Comment

by:gheist
ID: 40530163
Encrypted data is completely random. If it is not it means that particular encryption algorithm is broken.
RSA-2048 is not an encryption algorithm, it is something else:https://en.wikipedia.org/wiki/RSA_numbers#RSA-2048
0
 

Author Comment

by:street9009
ID: 40531543
Okay- tomato, tomahto. The terminology I used came from the fact that these are called "encryption viruses" and use "RSA-2048" to change the content of your files.

The question remains- can it be detected in C#?
0
 
LVL 62

Expert Comment

by:gheist
ID: 40531907
Yes, encrypted data is fully random, so all and every randomness test suites should confirm that.
http://csrc.nist.gov/groups/ST/toolkit/rng/documentation_software.html
Many tests will confirm that RAR and zopfli compression is random too, but ok, at least it will not missdetect good documents.
At least truecrypt detectors worked like that.
0
 

Author Comment

by:street9009
ID: 40531920
I don't see how to make this work in C# though...
0
 
LVL 45

Expert Comment

by:AndyAinscow
ID: 40531933
>>Yes, encrypted data is fully random, so all and every randomness test suites should confirm that.

I would say no you can not tell which encryption method is used unless you know the key then you can decrypt the file.  The question as I understand it isn't about is it encrypted but about is it encrypted with this stated method.
0
 

Author Comment

by:street9009
ID: 40531942
Really either would be helpful, though yes you are correct, I was hoping to detect that specific method.
0
 
LVL 62

Accepted Solution

by:
gheist earned 2000 total points
ID: 40532127
I doubt there is any good RNG test in C#, so if you want to do it really in .NET you must either make your own interface to native code, or port to C#. Source files of NIST tests make like 200KB togeter - like 200 screenfuls of code in total.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This article covers the basics of data encryption, what it is, how it works, and why it's important. If you've ever wondered what goes on when you "encrypt" data, you can look here to build a good foundation for your personal learning.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Suggested Courses

604 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