GnuCash
Contact   Instructions
Bug 667490 - Support image-based TAN methods QR, photoTAN, and chipTAN optical "Flicker code"
Summary: Support image-based TAN methods QR, photoTAN, and chipTAN optical "Flicker code"
Status: RESOLVED FIXED
Alias: None
Product: GnuCash
Classification: Unclassified
Component: Import - AqBanking (show other bugs)
Version: 2.4.x
Hardware: Other All
: Normal enhancement
Target Milestone: ---
Assignee: import
QA Contact: import
URL: https://gnucash.uservoice.com/forums/...
Whiteboard:
Keywords:
: 785411 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-01-08 04:14 EST by Norbert
Modified: 2020-12-30 23:08 EST (History)
20 users (show)

See Also:


Attachments
Support for PhotoTan (7.31 KB, patch)
2019-10-07 07:59 EDT, Mike Pieper
jralls: rejected+
Details
Code from 6xq.net (5.77 KB, application/x-javascript)
2020-04-21 04:16 EDT, max
no flags Details

Description Norbert 2012-01-08 04:14:22 EST
aqbanking support the optical chip tan since version 5.0.19. This security system is quite common in Germany. A sample implementation can be found in AqFinance 0.9.121beta. For the communication with the chipcard use this system a flicker picture.

Video: http://www.youtube.com/watch?v=U7PnC1S-j4I
Comment 1 Frank H. Ellenberger 2017-07-25 14:21:11 EDT
There are also requests at https://gnucash.uservoice.com/forums/101223-feature-request/suggestions/2654889-support-for-chiptan-comfort-smarttan-optic-flicke

The problem is most specs are in German while almost none coders are speaking German.

I started https://wiki.gnucash.org/wiki/Flicker to collect and tranfer information to English.
Comment 2 Frank H. Ellenberger 2017-07-25 14:38:58 EDT
*** Bug 785411 has been marked as a duplicate of this bug. ***
Comment 3 Frank H. Ellenberger 2017-07-25 14:44:10 EDT
In Bug 785411 - Display chipTAN "flicker" code for HBCI
John Ralls [reporter] [GnuCash developer] 2017-07-25 18:31:13 UTC wrote:

Many banks offering HBCI require authentication using the "chipTAN" system. In this system the bank sends an challenge code for the user to enter into a code generator that uses it to generate a "Transaction Authentication Number" or TAN to validate the transaction. The challenge code can be entered by hand (already supported by GnuCash) but that is cumbersome and error-prone. The code generators can also read the number from the screen using a so-called "flicker code".

Specifications are available from https://github.com/willuhn/hbci4java/blob/master/doc/tan_hhd_uc_v14.pdf

An MIT-licensed javascript implementation is available at https://github.com/my-flow/fintex/blob/master/lib/tan/flicker_code.ex

Proposal: Retrieve the challenge code from AQBanking and open an html tab/window containing the javascript and pass it the challenge code to display.
Comment 4 John Ralls 2017-09-24 18:16:36 EDT
Reassign version to 2.4.x so that individual 2.4 versions can be retired.
Comment 5 Wolfgang 2018-02-03 13:19:38 EST
(In reply to Frank H. Ellenberger from comment #3)
> In Bug 785411 - Display chipTAN "flicker" code for HBCI
> John Ralls [reporter] [GnuCash developer] 2017-07-25 18:31:13 UTC wrote:
> 
> Many banks offering HBCI require authentication using the "chipTAN" system.
> In this system the bank sends an challenge code for the user to enter into a
> code generator that uses it to generate a "Transaction Authentication
> Number" or TAN to validate the transaction. The challenge code can be
> entered by hand (already supported by GnuCash) but that is cumbersome and
> error-prone. The code generators can also read the number from the screen
> using a so-called "flicker code".
> 
> Specifications are available from
> https://github.com/willuhn/hbci4java/blob/master/doc/tan_hhd_uc_v14.pdf
> 
> An MIT-licensed javascript implementation is available at
> https://github.com/my-flow/fintex/blob/master/lib/tan/flicker_code.ex
> 
> Proposal: Retrieve the challenge code from AQBanking and open an html
> tab/window containing the javascript and pass it the challenge code to
> display.

"Proposal: Retrieve the challenge code from AQBanking and open an html
tab/window containing the javascript and pass it the challenge code to
display."

The proposal works in theory, but how can I retrieve the challenge code?
I can't seem to highlight it (to copy&paste).
Comment 6 John Ralls 2018-02-04 13:50:31 EST
That's a programming proposal, not something that a user can do.
Comment 7 Mechtilde 2018-03-20 02:35:09 EDT
add to CC
Comment 8 Heinz Repp 2018-05-09 04:52:11 EDT
additional info (in case you missed it):

- AqBanking supports chipTAN Flickercode since version 5.0.19 (and Gwenhywfar 4.3.1, both Dec 2011, current versions 5.7.8/4.20). Extracting and decoding of the bank challenge is already done by AqBanking, all GnuCash needs is a new dialog that calls the libaqbanking code and displays the Flicker code - Javascript doing this is already available (see comment 3) - and provides a text entry receiving the TAN.
Comment 9 Frank H. Ellenberger 2019-09-22 00:22:42 EDT
The (new) interface description:
https://www.aquamaniac.de/rdm/projects/aqbanking/wiki/ImplementTanMethods
Comment 10 Frank H. Ellenberger 2019-09-23 20:19:32 EDT
Christian reported on aqbanking-user, we have already a stub:
The function call is in
gnucash/import-export/aqb/gnc-gwen-gui.c Zeile 1414ff

But the utilization of the 3 parameters is still missing.
Comment 11 Ingo 2019-09-26 15:07:40 EDT
Does this bug also apply to support for optical TAN (aka PhotoTAN)?
btw: I am a natively German speaking developer and would like to add support for ChipTAN/PhotoTAN to Gnucash (3.7)...
Comment 12 Ben Bucksch 2019-09-26 22:59:59 EDT
I'm locked out of my bank accounts due to this. I need photoTAN of Deutsche Bank.
Comment 13 Ben Bucksch 2019-09-26 23:16:33 EDT
For the record, photoTAN does not work with a chipcard like chipTAN, but a smartphone app and is bound to the smartphone instead of the chipcard. It also doesn't use a flicker image, but a static colored QR image.

The user needs to scan/photograph this color image with his smartphone using an bank-specific Android/iOS app, which reads the color QR code, generates and displays a 7-digit TAN, and then the user needs to enter the TAN in the banking app.

Info:
* http://www.wikibanking.net/onlinebanking/verfahren/phototan/
* https://www.deutsche-bank.de/pk/digital-banking/sicherheit/phototan.html
* https://www.commerzbank.de/portal/de/privatkunden/hilfe-kontakt/services/tan-verfahren/phototan/phototan.html

Used by:
* Deutsche Bank (largest bank in Germany)
* norisbank
* Commerzbank (one of the largest banks in Germany)
Comment 14 Mike Pieper 2019-10-07 07:59:42 EDT
Created attachment 373416 [details]
Support for PhotoTan

I've added support for new challenges as delivered from aqbanking.
Currently I could only test the PhotoTan challenge. This works for me.

A flicker code I personaly would implement via generating an animated gif from the given code and present it the same way like the PhotoTan image. Currently I have no account which needs  a flicker code.
Comment 15 John Ralls 2019-10-07 11:40:59 EDT
Comment on attachment 373416 [details]
Support for PhotoTan

Thanks, but we already have a PR for phototan and chiptan-QR, https://github.com/Gnucash/gnucash/pull/586

I like an animated gif for the flicker code better than my idea, which was to use a GtkAnimation. The animated gif would be more portable to different GUI backends.

Your patch appears to be against the 3.7 release. The codebase in git has moved substantially since then so it would have to be substantially redone to be acceptable. That's probably not worthwhile considering the almost-ready PR.
Comment 16 Lucki1+bugsgnucash 2020-01-16 07:17:29 EST
Since GnuCash 3.8 this should be included (?) but sadly I'm not presented with the animated optical flicker code. The window is popping up and expecting me to see it but it's not there.

I can force the whole process to use the text input fallback but that's a bit more inconvenient.
Comment 17 John Ralls 2020-01-16 12:38:47 EST
3.8 implements the new photo and QR TAN methods but not Flicker. Sorry.
Comment 18 max 2020-04-17 04:13:43 EDT
I'm currently only have a Flicker-Tan-Generator. I'm not sure whether is makes sense to implement the flicker code as the banks in germany seem to move to the QR method.

Nonetheless, does anyone have experience how open the "flicker"-code standard is?
Comment 19 John Ralls 2020-04-17 12:57:12 EDT
Pretty open, see comment 3.
Comment 20 Frank H. Ellenberger 2020-04-17 14:31:42 EDT
I am not sure, how it can help us, but the CLI aqhbci-tool4 got a new parameter:
 [--opticaltan=PARAM]
   Specify an external tool to display optical TAN challenges
There you can specify the path to gwenview or whatever program you prefer.

Re comment 18: the easiest would be to display an animated GIF.
Other options: Adobe Flash, JS or Java.
Comment 21 Ingo 2020-04-17 16:32:45 EDT
(In reply to max from comment #18)
> I'm currently only have a Flicker-Tan-Generator. I'm not sure whether is
> makes sense to implement the flicker code as the banks in germany seem to
> move to the QR method.
> 
> Nonetheless, does anyone have experience how open the "flicker"-code
> standard is?

cf. https://wiki.ccc-ffm.de/projekte:tangenerator:start
Comment 22 Ingo 2020-04-17 16:53:42 EDT
@jralls What would you suggest for creating the animated GIF from within GTK (to stay as portable as possible)? I think it will be a minor afford to port the existing bash/JS code...
And at the moment, I have got spare (coding) time ;-)
Comment 23 max 2020-04-17 17:24:26 EDT
Alright, when you try `aqbanking-cli --opticaltan=/bin/echo request --aid=2 --transactions`, then aqbanking-cli provides you with the output:

text/x-flickercode XXXX111111

This means we have to find/write a C library to do the generation of the image series, right?
Comment 24 John Ralls 2020-04-17 20:09:13 EDT
Ingo, GnuCash has WebKit built in. Just wrap the JS in html and stuff it in a gtkwebkitwebview like Frank suggested in comment 3.
Comment 25 max 2020-04-19 16:02:51 EDT
I think the code from here should do the job: https://6xq.net/flickercodes/

I also played with the "offical" js code from the sparkasse which is from REINER SCT. It is quite a mess and there is no license information :/
Comment 26 Ingo 2020-04-20 16:05:55 EDT
(In reply to max from comment #25)
> I think the code from here should do the job: https://6xq.net/flickercodes/
> 
> I also played with the "offical" js code from the sparkasse which is from
> REINER SCT. It is quite a mess and there is no license information :/

I also stumbled across the "official" JS code from REINER SCT. It is used also bei DKB bank. Is it worth the effort to contact REINER SCT and ask for licensing terms or should we use the code from 6xq.net (btw: is it GPL/license-compatible to Gnucash)?
Comment 27 max 2020-04-21 04:15:41 EDT
@Ingo the license from https://6xq.net/flickercodes/ is MIT. I'm no expert in licensing but it seems to be compatible: https://en.wikipedia.org/wiki/License_compatibility#GPL_compatibility

I was also thinking about contacting REINER SCT. But maybe we can first try to use the open-source one and wait for bug reports. The "core" of the flicker code does not seem complex.
Comment 28 max 2020-04-21 04:16:47 EDT
Created attachment 373656 [details]
Code from 6xq.net
Comment 29 Ben Bucksch 2020-04-21 08:52:43 EDT
Thanks, Max! I looked superficially at the code, and it seems to be of good quality, very readable, and reasonable.

Yes, MIT is compatible with GPL (as far as I know).

Given that it's good quality code and a liberal license, I would recommend to use this and not bother with REINER SCT.
Comment 30 Ingo 2020-04-21 08:55:04 EDT
(In reply to Ben Bucksch from comment #29)
> Thanks, Max! I looked superficially at the code, and it seems to be of good
> quality, very readable, and reasonable.
> 
> Yes, MIT is compatible with GPL (as far as I know).
> 
> Given that it's good quality code and a liberal license, I would recommend
> to use this and not bother with REINER SCT.

Ok, then lets go ahead and integrate the 6xq-code as @jralls proposed. I wonder if it is necessary to add things like resizing of the flicker canvas, speed control and replay options (via buttons)?
Comment 31 Ingo 2020-04-21 11:24:18 EDT
I have started to work on the integration and am struggling with the webview. Here is my question: Should the HTML+JS be
a) in a file and then loaded into the webview (if so, where to put the file and how to load it?), or
b) "hardcoded" into a long gchar inside the source code.
Suggestions are welcome :-)
Comment 32 John Ralls 2020-04-21 12:51:52 EDT
Put it in a file and load it. The source location should be in gnucash/import-export/aqb and it should install to a new directory in share/gnucash/. The various chart reports can serve as examples although they're in Scheme rather than C.
Comment 33 Ingo 2020-04-21 13:22:11 EDT
@jralls Thanks, that helps 8-)
Comment 34 Ingo 2020-06-06 07:01:47 EDT
There was a new proposal for implementing the flicker code at the mailing list (https://lists.gnucash.org/pipermail/gnucash-de/2020-June/011622.html).
I am still not sure what is the better way: a) webview+HTML+JS (as discussed above) or b) "native" implementation in C.
Please comment/vote on this...
Comment 35 John Ralls 2020-06-06 12:25:04 EDT
I imagine that the better UX would be a dialog box with the flicker code and a button to dismiss it. That would have to be in C/C++. But either way is a better UX than what we have now, so ISTM more important which one you think you can implement.
Comment 36 Christian Wehling 2020-12-29 14:53:35 EST
chipTAN optical (Flicker) was implemented with Commit #580975b and is available since 4.3.
Comment 37 Frank H. Ellenberger 2020-12-29 18:36:07 EST
Is there still something missing or can we close this bug?
Comment 38 Rainer Dorsch 2020-12-30 04:19:52 EST
I could not test yet the Flicker part on Linux, newest version in Debian is 4.2:

rd@h370:~$ rmadison gnucash
gnucash    | 1:2.6.4-3        | oldoldstable           | source, amd64, armel, armhf, i386
gnucash    | 1:2.6.15-1       | oldstable              | source, amd64, arm64, armel, armhf, i386, mips, mips64el, mipsel, ppc64el, s390x
gnucash    | 1:3.4-1          | stable                 | source
gnucash    | 1:3.4-1+b10      | stable                 | amd64, arm64, armel, armhf, i386, mips64el, mipsel, ppc64el, s390x
gnucash    | 1:3.10-1~bpo10+1 | buster-backports       | source, mips
gnucash    | 1:3.10-1~bpo10+1 | buster-backports-debug | source
gnucash    | 1:4.2-1~bpo10+1  | buster-backports       | source, amd64, arm64, armel, armhf, i386, mips64el, mipsel, ppc64el, s390x
gnucash    | 1:4.2-1~bpo10+1  | buster-backports-debug | source
gnucash    | 1:4.2-1          | testing                | source
gnucash    | 1:4.2-1          | unstable               | source
gnucash    | 1:4.2-1          | unstable-debug         | source
gnucash    | 1:4.2-1+b2       | testing                | amd64, arm64, armel, armhf, i386, mips64el, mipsel, ppc64el, s390x
gnucash    | 1:4.2-1+b2       | unstable               | amd64, arm64, armel, armhf, i386, mips64el, mipsel, ppc64el, s390x
rd@h370:~$
Comment 39 Frank H. Ellenberger 2020-12-30 05:23:58 EST
(In reply to Rainer Dorsch from comment #38)
> I could not test yet the Flicker part on Linux, newest version in Debian is
> 4.2:

As long as they do not have it in backports, you can try https://wiki.gnucash.org/wiki/De/Flatpak.
Comment 40 Christian Wehling 2020-12-30 07:56:40 EST
(In reply to Frank H. Ellenberger from comment #37)
> Is there still something missing or can we close this bug?

In my opinion, the bug is fixed. However, I do not have the authorization to set the status to "Fixed".
Comment 41 Joachim.Herb 2020-12-30 18:18:31 EST
I can confirm that it is working with gnucash 4.4 on gentoo using the latest ebuild.

To set it up, especially the setTanMediumId, see https://www.aquamaniac.de/rdm/projects/aqbanking/wiki/SetupPinTan (cT:YOUR NAME_1 or something like this, see your settings on the online banking site)

P.S. Why are there two bug trackers and actually two bugs for this? This bug here and one at https://github.com/Gnucash/gnucash/pull/819 which I only found by searching for the commit hash at the github repo mentioned in comment #36.
Comment 42 Ben Bucksch 2020-12-30 18:22:56 EST
> Why are there ... two bugs for this? This bug here and one at
> https://github.com/Gnucash/gnucash/pull/819 

The latter is not a bug, but it's a "pull request", meaning the code contribution (which fixes this bug) and the discussion about the code. In fact, the pull request specifically mentions "Bug 667490" (= this bug here) in the title.
Comment 43 Frank H. Ellenberger 2020-12-30 23:08:44 EST
Or: here is the bugand in the PR on github is the fix.

Closing…

Note You need to log in before you can comment on or make changes to this bug.