To summarize my problem, I want to adapt an encryption algorithm written in Javascript to the Java side. The content produced here is used in the header of the service I am calling. But even though I have tried many ways, I have not been able to find the real algorithm yet. The algorithm written in Javascript is as follows: