

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Using the SHA256() function
We construct with four fields a concatenated code without special characters (no accents, no hyphens) or capital letters, assembled with pipe characters: |
This code is then hashed with a SHA256 function.
Example
Will have initial code: demezancon|jeanfrancois|21121987|99129
Once hashed: 2a5bc014151a1b36c93ae134100f6f474283712d91d58f51ddc169fa3224a7b3
But when I use the following function: Hash256('demezancon|jeanfrancois|21121987|99129')
I get a totally different result: LS;:]<+<%>::)U9:#&Q<58`EWE<>RU!KGN:8ZS,EU
I can't figure out what's missing in my formula to get the expected result.
Thank you in advance for your help.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@ceosis79 As per this, Hash256 - script and chart function | Qlik Sense on Windows Help It seems the result is OK?
But, The title says SHA256()?


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Qlik Hash256() does not use the same hashing algorithm as SHA256(). SHA256() would use SHA, while Hash256() apparently uses something different.
https://support.qlik.com/articles/000026464
You'll find other questions in this forum about how to possibly replicate SHA256 in Qlik Sense. I don't think it's possible without using an external routine like an SSE.
-Rob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@ceosis79 As per this, Hash256 - script and chart function | Qlik Sense on Windows Help It seems the result is OK?
But, The title says SHA256()?


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Ceosis.
I would need to know how you are concatenating the fields and how you are using that concatenation in hash256() so that it returns 2a5bc014151a1b36c93ae134100f6f474283712d91d58f51ddc169fa3224a7b3
Because I have used this script :
My_TABLE:
load *, a&'|'&b&'|'&c&'|'&d as h;
LOAD * INLINE[
a,b,c,d
demezancon,jeanfrancois,21121987,99129
];
and the results that always give me the same:
hash256(a&'|'&b&'|'&c&'|'&d) --> LS;:]<+<%>::)U9:#&Q<58`EWE<>RU!KGN:8ZS,EU
hash256(h) --> LS;:]<+<%>::)U9:#&Q<58`EWE<>RU!KGN:8ZS,EU
hash256('demezancon|jeanfrancois|21121987|99129') --> LS;:]<+<%>::)U9:#&Q<58`EWE<>RU!KGN:8ZS,EU
Except when I use this sentence:
hash256(a,b,c,d) --> HP"^B!*T9M.%"*(6D4F.16PV>_%#:GL<U[C]LZR\\H#


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello @jmmayoral3 and @Anil_Babu_Samineni
The example is provided by my central administration, when I saw a different output I checked the calculation with various online tools and get the same result than the example :
https://passwordsgenerator.net/sha256-hash-generator/
https://emn178.github.io/online-tools/sha256.html
https://tools.keycdn.com/sha256-online-generator
Maybe the Qlik Sense function hash256() needs a specific argument to define the proper algorithm or I need to use an other function.
Could you guys help tel me how to achieve this in Qlik Sense ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@ceosis79 Can we know what you want to use after you use below one?
Hash256('demezancon|jeanfrancois|21121987|99129').
I can see @jmmayoral3 explained the same how Qlik works.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Qlik Hash256() does not use the same hashing algorithm as SHA256(). SHA256() would use SHA, while Hash256() apparently uses something different.
https://support.qlik.com/articles/000026464
You'll find other questions in this forum about how to possibly replicate SHA256 in Qlik Sense. I don't think it's possible without using an external routine like an SSE.
-Rob


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Rob, for your explanation.
It's clear now that Qlik Sense function Hash256() is not a solution for me to provide this encrypted field in the format I have to deliver.
I should have notice like @Anil_Babu_Samineni the subtle difference between SHA256 and HASH256 !
Sorry to have bother you three with this beginner's question…
Best regards
Vladimir
