Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decryption failed reading BTD with Monte dei Paschi di Siena banque in EBICS V3 #201

Open
NanoNao opened this issue Nov 19, 2024 · 10 comments

Comments

@NanoNao
Copy link

NanoNao commented Nov 19, 2024

Hello everyone.

I'm currently trying to read a CFONB120 for a BTP response. Unfortunately, the library catches a LogicException with this error message “Decryption failed”. I use EBICS 3.0

I've already used this library with another bank and everything was OK. I've already tried to solve this problem with the bank. But nobody has an answer to this problem.

I don't really know where to start looking or what to look for. I don't even know if the problem is with the lib or the bank. Do you have any clues about this problem?

Thank you and have a nice day

Version : 2.x-dev
Not using password for this test.

@andrew-svirin
Copy link
Member

Hello @NanoNao what version of library do you use?

@NanoNao
Copy link
Author

NanoNao commented Nov 19, 2024

Im using 2.x-dev

@NanoNao
Copy link
Author

NanoNao commented Nov 19, 2024

For more information, the error occurs in “decryptOrderDataCompressed” when the “decryptByKey” method is called. I wonder if $transactionKeyDecrypted is correct.

@andrew-svirin
Copy link
Member

andrew-svirin commented Nov 19, 2024

You can try to updated keyring by next:

$hpb = $client->HPB();
$keyringManager = new FileKeyringManager();
$keyringManager->saveKeyring($client->getKeyring(), $keyringRealPath);

And check if keyring file was modified.

@NanoNao
Copy link
Author

NanoNao commented Nov 19, 2024

Thanks for your reply.

I've already tried it. I even created a new ebics contract with the . But I always get this error.

My main question is whether it's a problem with the lib or the data sent by the bank.

@NanoNao
Copy link
Author

NanoNao commented Nov 19, 2024

$transactionKeyDecrypted length is 16long, it should be 128 according to $aes->setKeyLength(128); or am I wrong ?

@andrew-svirin
Copy link
Member

I believe this is the error with the lib. Should be investigated this scenario. Does HPB responses correctly?

@NanoNao
Copy link
Author

NanoNao commented Nov 19, 2024

I've just checked and it seems that the keys in my keyring are correct.

In decryptOrderDataCompressed() my $signatureE->getPrivateKey() seem to be good (same as send in HPB)
I use empty string password so maybe we can exclude this probleme too.

Also i can decode data send in HPB with this same methode, so we can exclude problème with myPrivateKey.

@andrew-svirin
Copy link
Member

It could happen with wrong password. Try to settle password by

$client->changeKeyringPassword('some_new_password');

@NanoNao
Copy link
Author

NanoNao commented Nov 25, 2024

I'm sorry for the response time, I've done a new test but I'm getting abnormal response times from the bank with timeouts on their side. Unfortunately, I'm still waiting for a reply from them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants