I am trying to store the data as secured possible way in database.
For that I am triyng to implement the SHA-256 algorithm in Powerbuilder version 6.5.
This sound old that I am implememting the SHA 256 in PowerBuilder (Desktop Application Development Tool).
Though yet it is outdated we need to implement this secure functionality in PowerBuilder
Because lots of applications are dependant on it.
I Googled for any library for PB 6.5 for SHA256 but didn't get anything.
So please can any one tell me how can I achieve this SHA-256 in PowerBuilder or is there any ready library available fot SHA256 for PB 6.5.
Thanks in Advance.
Have a look at this PB library wich uses the Microsoft Crypto API.
The example is for PB 8+, I've managed to have it running in PB7 by exporting the nvo and windows objects and importing them in a new PB7 library.
According to the MSDN documentation you'll have to use the "Microsoft Enhanced RSA and AES Cryptographic Provider" to be able to calculate the SHA256 hash.
Related
I have been trying for a while to do some basic cryptography on my Mac OS X Mavericks. I would need MD5, SHA256, AES and possibly also RSA.
I need to develop in C++ but I only need a terminal application with Xcode. I DON'T need to do anything on iPhone. I have a very basic configuration and I am not an expert. I tried crypto++ and OpenSSL, both gave me immense lists of errors at build time.
Thanks!
Apple supplies several encryption Technologies Specific to OS X: General information.
CommonCrypto, a C-level API that can perform most symmetric encryption and decryption tasks
CDSA/CSSM—a legacy API that should be used only to perform tasks not supported by the other APIs, such as asymmetric encryption.
Security Transforms API—a Core-Foundation-level API that provides support for signing and verifying, symmetric cryptography, and Base64 encoding and decoding.
There is also OpenSSL, it is useful for many command line operations but is no longer provided by Apple mainly due to the incompatibilities between versions.
CommonCrypto is supported by both OSX and iOS, this is what I generally use. Security Transforms are OSX only and the newer technology. There are many examples of CommonCrypto usage on SO as well as libraries in GitHUb.
My suggestion is CommonCrypto, it is a "C" library so there should be no problem using it from C++.
I'm in a situation that I need to use AES-256, SHA1,2 and RSA, but these functions need to be loaded from an intrinsic windows dll file (something like cryptoAPI in advapi32.dll, which can be found in C:\Windows\system32).
I've found almost everything I need in advapi32.dll except RSA encryption. So,do you know any other crypto libraries from windows (XP2 should be supported)?
In the worst case, any free external crypto library in dll format is appreciated.
RSA encryption/decryption is supported by the CryptoAPI.
From http://en.wikipedia.org/wiki/Microsoft_CryptoAPI:
[...]It is a set of dynamically linked libraries that provides an abstraction layer which isolates programmers from the code used to encrypt the data.
So, advapi32.dll ≠ CryptoAPI. However, since it is an abstraction of the CryptoAPI functions, linking to that dll should expose whichever functionality you need, algorithm-agnostic.
To answer the question strictly, the CSP library file that handles RSA stuff is rsaenh.dll. However, I'm not sure why you should need to know that necessarily; like #SimonMourier (and I) stated, CryptoAPI handles linking to the appropriate CSP. Calling the appropriate functions from advapi32.dll should allow the use of a variety of algorithms, including RSA.
If you're really that averse to using the built-in Windows stuff then there's always Crypto++. It supports being compiled as a DLL afaik. http://www.cryptopp.com/
Without using .Net or a 3rd party component, I've found no reasonable solution for RSA in windows. So, about .Net, please see klugerama's last comment. About 3rd party component, I've found a great library for VB6 user, which will works in Windows XP without the installation of .NetFramework 2.0+. It's called VBCOrLib :
http://www.kellyethridge.com/vbcorlib/
Alternative solution for C++ users was Crypto++ as suggested by RaptorFactor.
Thanks for all your helps !
I am writing a program for Windows 8 that encrypts a lot of data (over 100MB at a time) and have noticed that even when using multi-threading, the encryption APIs on Windows 8 are slower than the Cryptographic Service Providers (CSPs) on previous versions of Windows. I was wondering if there was a faster way to encrypt files using AES on Windows 8.
Microsoft CryptoAPI Next Generation (CNG) is a successor of old CSPs,it's fully native. First implemented in Windows Vista, it is still available in W8.
Why not to use them?
You can try the SecureBlackbox library, it is commercial (with free trial), but implements all the stuff on it's own.
And, anyway, any managed code will be somehow slower than native one.
I am trying to write my own CSP. I am trying to do this by implementing a dll file, but I am not sure if I am on right way.
I found something like this:
Cryptographic Service Provider Developer's Toolkit (CSPDK)
there are samples with CSP API
CPAcquireContext
CPGenKey
... etc.
(it looks for me like an old api or api for winCE)
And here comes my question, which functions should I implement to provide new CSP for windows 7 and XP.
Is my plan good? - should I implement simple DLL and put her reference in register?
Or am i missing something?
You might be missing CNG which is a (long term) replacement for the MS Crypto API. You can create modules for that as well. Unfortunately it is only available since Vista. Windows XP is too old (and you should probably not be producing new applications for XP anyway).
Your HSM vendor will have their CSP written for you. You will get this csp when you install their driver. All you will be required is to access this CSP from your code.
To interface with your HSM vendor's CSP(check what they support), either you should use PKCS#11 or use the cryptoAPI CSP functions.
I'm porting some compact framework code that consumes a RESTful service to Windows Phone 7. The REST service requires md5 hashing and method signatures.
This code (which worked on NETCF) no longer compiles and I don't see anything MD5 related in the object browser.
MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider();
buffer = md5.ComputeHash(buffer);
Is md5 not supported on WP7?
A quick googling reveals that some cryptography classes are not supported in any Silverlight versions. One of these is MD5CryptoServiceProvider.
You can use this MD5 implementation for Silverlight on Windows Phone 7.
AES is supported on Phone 7. If you need MD5, you need to look elsewhere.