I have to do something like (pseudocode): base64encode(hexencode(sha256(text)))
base64encode and hexencode are functions in FileMaker. But how do I do SHA256 encryption?
Based on the documentation that you linked to you don't need plugins - all you're trying to do is create a hash to use as an authorization header. As Clay pointed out you can do this with the CryptDigest function, so to replicate in FileMaker the documentation you posted you'd do
Base64Encode( HexEncode ( CryptDigest( "***your string***" ; "SHA256" ) ) )
See FileMaker Pro 16 Help for details on CryptDigest.
Note that you may also need to look at the Base64EncodeRFC instead of 'plain' Base64Encode if you don't get the results you expect - FileMaker Pro 16 Help I have found that when generating auth headers they can be a bit picky!
Look at the CryptAuthCode function
Thats what I also found. But it expects a third parameter 'key' which I don't have in this case.
There must be a way to produce an SHA256 hash without key, like this site does: SHA-256 hash calculator. Online SHA-256 hash generator. Mining Bitcoin
Any way to do this from FileMaker?
the "key" is
any text expression or field as the key to encrypt data with.
(you supply the key)
You have to generate your own key. And put it in a safe place. If you encrypt data and lose the key, the data can not be retrieved... Obviously you don't want to store the key in such a way that someone who can grab a copy of your file cannot find the key and decrypt the data.
Effective and secure key management is not a trivial thing.
This is what I try to do: 1. Prepare your checkout - Klarna Developers 1. Prepare your checkout - Klarna Developers
They want simply SHA256(text) without key ...
You might need some ScriptMaster assistance here...
see this for methods, which are quite simple
encryption - How to hash some string with sha256 in Java? - Stack Overflow
Are you trying to encrypt the data or just make a digest (i.e. signature) of the data? It sounds like you want to make a digest, not encrypt something. The standard digests are made by CryptDigest and then there are HMAC style encrypted digests that CryptAuthCode makes.
Please use SHA256 or similar to create key for encryption from a clear text password.
Than use AES, Blowfish or other codec to encrypt.
see universal Encryption.Cipher method in MBS FileMaker Plugin.
Yes it is a digest, not an encryption. So my title was misleading, sorry.
Base64EncodeRFC ( 4648 ; la, la, la...
a number to remember - it encodes without line breaks
By default FileMaker was 2045 using Base64Encode.
Retrieving data ...