Are ECDSA and ECDH available for mono? - xamarin.ios

The question pretty much sums it up. Are ECDSA and ECDH available for mono? If they are not, will they be?

No they are not available inside Mono BCL, nor Xamarin.iOS or Xamarin.Android.
There's a bug report for each of them, ECDSA and ECDH, so you might want to add yourself on c.c. to know when this will change. Right now there's no time table to include them.

Microsoft .NET supports both,
http://msdn.microsoft.com/en-us/library/system.security.cryptography.ecdsacng.aspx
http://msdn.microsoft.com/en-us/library/system.security.cryptography.ecdiffiehellmancng.aspx
From both Mono source code and documentation you can see that ECDSA and ECDH are not supported, as the corresponding classes are missing,
https://github.com/mono/mono/tree/master/mcs/class/System.Core/System.Security.Cryptography
http://docs.go-mono.com/?link=N%3aSystem.Security.Cryptography
For Xamarin.iOS and Xamarin.Android which are derived from Mono, you might check if there are any native library to call.

You can try to use "The Legion of the Bouncy Castle". It's fully written in .NET and supports many signature and encryption algorithms. I found it a bit tricky to use, there's not a lof of documentation, but it works.
Try to find a NuGet package or visit their website:
http://www.bouncycastle.org/csharp/

Related

How to play drm contents in cobalt

I am developing using cobalt master.
I want to play the drm contents using cobalt. but as far as i know, cobalt(open-source) is not integrated with widevine or playready due to license.
So I have to the widevine integrating.. But I don't know what to do..
Below is question lists. I'd really appreciate it if your guys could answer this.
I found the sources about widevine in the cobalt source tree('cobalt/src/starboard/shared/widevine')
I think it is about widevine porting. then I just need to put in the widevine.so or the widevine source.
Is it right?
I made a ce_cdm(it is widevine 3.5 source) derectory in 'cobalt/src/third_party' and then tried 'cobalt/build/gyp_cobalt -C debug linux-x64x11' but following message is printed the Terminal.
$cobalt/build/gyp_cobalt -C debug linux-x64x11 gyp: Dependency '/home/amedia/cobalt4/cobalt/src/third_party/boringssl/boringssl.gyp:crypto#host' not found while trying to load target /home/amedia/cobalt4/cobalt/src/starboard/shared/widevine/widevine3.gyp:protoc#host
I have no idea what this means...
Please let me know if your guys have a guide or a way to do this.
Thank you.
From the gyp errors it looks like the version of widevine you have depends on boringssl which is not currently supported by Cobalt 19. And you might have some trouble integrating boringssl because it is a fork of openssl which is used by multiple components in Cobalt 19.
It might not be too difficult to replace openssl with boringssl. And maybe you can find a version of widevine that's also compatible with openssl, though I'm not sure about the feasibility.
Please also stay tuned to Cobalt's release announcements. We regularly upgrade our third party libraries and you should find new Cobalt releases easier to integrate with additional libraries.

Securing encryption algorithm in node js?

We are using crypto package in our node js app. The thing is we do not want the developer to know about the encryption algorithm we implemented. However, the developer would be knowing the encryption algorithm and the encryption key as they can view the source code of the encryption algorithm.
So my question is: is it possible to compile the encryption algorithm into a file like dll(.NET) or jar file (java) and include it in the project (open source solution). If not, how to prevent developer from viewing the source code?
The final expectation is the developer will know we use crypto package, but do not know we use what algorithm and key we implemented.
Note: I do not expect solution of restricting file access to the user nor hosting it in another environment.
node-ffi is a Node.js addon for loading and calling dynamic libraries using pure JavaScript. It can be used to create bindings to native libraries without writing any C++ code.
https://github.com/node-ffi/node-ffi

How to debug Java cryptography extensions?

I am implementing an encryption algorithm with a product. I would like to understand how bouncy castle handles the defaults like Initialization vector and so on. But I am not able to get any breakpoint working in intellij, I think it has got something to do with JCE provider.

How to get signature list from PGPPublicKey using Bouncy Castle library?

I have a PGPPublicKey object. I want to get a list of all signatures(with UserId, email Id, trust level for each singature) associated with it using Bouncy Castle API. I tried but couldn't get it. If anyone has an example link or knows which method to use to get it, please let me know.
I've never used these classes but I thought it might be helpful to post some resources.
It looks like the Bouncy Castle OpenPGP releases include some examples.
I recommend using these examples to solve your problem. Specifically, it looks like you will need to use PGPSignatureList and PGPSignature classes which are utilized in the examples. However, I don't see emailId in any of the classes.
SignedFileProcessor.java: A simple utility class that signs and verifies files.
DetachedSignatureProcessor.java: A simple utility class that creates seperate signatures for files and verifies them.
Also, http://www.bouncycastle.org/documentation.html suggests the following.
Finally there are also code examples from Beginning Cryptography with Java which demonstrate both the use of the JCE/JCA and also some of the Bouncy Castle APIs such as for certificate generation, CMS and S/MIME. Note: the book was written to cover J2SE 5.0, while many of the examples will work with earlier JDKs, some will not compile if you are not using J2SE 5.0 or later.

Nuget Moq 4.0.10827 and InternalsVisibleTo (Again)

I have been trying to get Moq (or rather Castle.Core) to create proxies for my internal types.
The following (when added to my project under test), allows things to work:
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]
However this (more secure version) does not:
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=002400000480000094000000060200000024000052534131000400000100010077f5e87030dadccce6902c6adab7a987bd69cb5819991531f560785eacfc89b6fcddf6bb2a00743a7194e454c0273447fc6eec36474ba8e5a3823147d214298e4f9a631b1afee1a51ffeae4672d498f14b000e3d321453cdd8ac064de7e1cf4d222b7e81f54d4fd46725370d702a05b48738cc29d09228f1aa722ae1a9ca02fb")]
Note: the public key here differs to that documented here, I re-checked the public key of the Castle.Core.dll that ships with the current Nuget version of Moq.
Do I still have the wrong key?
[EDIT]
I have noticed the full Moq download from the official site (rather than Nuget) contains a NET40-RequiresCastle folder with a smaller dll, which implies that the Castle.Core code has been included in the default Moq.dll I guess.
I was looking at the Castle.Core.dll they provide for Silverlight and assuming they'd have used the same version throughout?
I know this is old, but for anyone who stumbles across this, I was having a versioning issue with Pex and Moq at one point, and wound up finding the most direct and useful approach to be the Strong Name Tool. That is, I found opened a Visual Studio command prompt and used "sn -Tp ThirdPartyAssembly.dll" to query it for the key directly. This proved a lot more efficient than perusing the internet looking for different, documented public keys to try out.

Resources