Click here to Skip to main content
11,709,844 members (75,066 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C# C#4.0 Encryption Decryption , +
I am trying to implement a windows form application in C# and most of stuff available online... but can someone tell how to implement below mentioned process - 2 for video file Decryption and stream directly to media player without saving file to disk.


PROCESS - 1 Video Encryption Process
Video File >> Read file >> encryption >> save to a file

PROCESS - 2 Video Decryption and Streaming Process
Encrypted File >> Read from file >> decryption >> stream to media player (axWindowsMediaPlayer)

Total Process Used
Reading file
- file-stream
- in byte array
- frame-wise
- Buffer
Encryption / Decryption
- many ways or this and many more...
Save to file
- normal algorithm
Video Streaming
- don't know Frown | :(

I read many stuff online but this i don't found. Secondly somebody suggest not to waste time on DRM as its not safe... someone on another forum suggest to swap initial bits so that while playing it get garbage value and not play directly and implement re-swapping programmaticly.
Posted 20-Jun-13 1:57am
Edited 20-Jun-13 2:02am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Everything you linked to concerns itself with encrypting/decrypting files, which must be written to other files and MediaPlayer won't play content from a buffer of your choosing in memory.

To do this without using an unencrypted file or custom media server, you'd be writing a codec to do the encryption/decryption. It would have to be part of the graph that MediaPlayer builds to play the content.

This is something that you really shouldn't use C# for. You'd be using C to do this and you can find some documentation on what's involved
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

There is a way using virtualization, for example here you may find a really BIG tutotial which seems to do exact what you need: firstly it crypts video file some way, and then it is able to play directly from the encrypted source, decrypting it on the fly.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 514
1 OriginalGriff 250
2 Peter Leow 229
3 Maciej Los 180
4 Mika Wendelius 175
0 OriginalGriff 9,428
1 Sergey Alexandrovich Kryukov 9,037
2 CPallini 5,189
3 Maciej Los 4,991
4 Mika Wendelius 3,856

Advertise | Privacy | Mobile
Web03 | 2.8.150819.1 | Last Updated 5 Aug 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100