Author Topic: io_crypt - encrypt your photos while you shoot them  (Read 108778 times)

g3gg0

  • Developer
  • Hero Member
  • *****
  • Posts: 3190
Re: io_crypt - encrypt your photos while you shoot them
« Reply #25 on: February 10, 2014, 12:11:09 AM »
can you:
 - load and enable trace.mo
 - start camera
 - set password using password encrypion
 - shoot one image
 - poweroff

and send me both log and image please?
Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: paypal@g3gg0.de
ONLY donate for things we have done, not for things you expect!

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: io_crypt - encrypt your photos while you shoot them
« Reply #26 on: February 10, 2014, 12:26:56 AM »
ha, didn't think to log it.

shit, I'm not getting the log... even if I comment out the if(1) in iocrypt_init

g3gg0

  • Developer
  • Hero Member
  • *****
  • Posts: 3190
Re: io_crypt - encrypt your photos while you shoot them
« Reply #27 on: February 10, 2014, 01:09:45 AM »
comment out the -DTRACE_DISABLED in Makefile ;)
Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: paypal@g3gg0.de
ONLY donate for things we have done, not for things you expect!

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D

eos

  • New to the forum
  • *
  • Posts: 9
Re: io_crypt - encrypt your photos while you shoot them
« Reply #29 on: February 10, 2014, 09:02:26 PM »
[650D; M; 9.feb nightly; iocrypt 9.feb 19:44; io_decrypt.exe 09.feb]

decoded .cr2 & .jpg still not readable (neither pw nor rsa).

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: io_crypt - encrypt your photos while you shoot them
« Reply #30 on: February 10, 2014, 09:03:54 PM »
Do the log like I did.... maybe g3gg0 can compare the 2

g3gg0

  • Developer
  • Hero Member
  • *****
  • Posts: 3190
Re: io_crypt - encrypt your photos while you shoot them
« Reply #31 on: February 10, 2014, 09:40:21 PM »
fixed a bug that happened rarely on the 5D3 and sometimes on the 7D.
reason was an odd address offset that i didnt handle cleanly on block size borders.

should fix the issue you had, 1%
Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: paypal@g3gg0.de
ONLY donate for things we have done, not for things you expect!

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: io_crypt - encrypt your photos while you shoot them
« Reply #32 on: February 10, 2014, 11:39:13 PM »
Ok, will give it a go.

It appears to be working... the files now decrypt in camera and when you don't set the right password they do not. Can't test the RSA unless you updated the exe

Code: [Select]
c:\mingw\include\io.h:302:39: error: unknown type name 'off64_t'
 __CRT_INLINE off64_t lseek64 (int fd, off64_t offset, int whence) {
                                       ^
In file included from crypt_rsa.c:24:0:
c:\mingw\include\unistd.h:65:20: error: unknown type name 'off_t'
 int ftruncate(int, off_t);

g3gg0

  • Developer
  • Hero Member
  • *****
  • Posts: 3190
Re: io_crypt - encrypt your photos while you shoot them
« Reply #33 on: February 10, 2014, 11:50:42 PM »
still get an error 70 during series shooting, which i am currently tracking down.
Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: paypal@g3gg0.de
ONLY donate for things we have done, not for things you expect!

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: io_crypt - encrypt your photos while you shoot them
« Reply #34 on: February 11, 2014, 12:03:16 AM »
Wonder if the other iodev_ctx I had will work too since behavior was the same with both.. previous was pointer to somewhere, current goes to 0.

eos

  • New to the forum
  • *
  • Posts: 9
Re: io_crypt - encrypt your photos while you shoot them
« Reply #35 on: February 13, 2014, 07:34:46 PM »
Sorry, I've been very busy in the last days.
I have no toolchain. So can someone give me a download to a compiled trace.mo?

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: io_crypt - encrypt your photos while you shoot them
« Reply #36 on: February 14, 2014, 02:07:23 AM »
Ok, EOSM is working:

Code: [Select]
    else if(streq(camera_model_short, "EOSM"))
    {
        iodev_table = 0x6F518;
        iodev_ctx = 0x9C4A8;
        iodev_ctx_size = 0x20;
    }

Only tested password... did jpegs

g3gg0

  • Developer
  • Hero Member
  • *****
  • Posts: 3190
Re: io_crypt - encrypt your photos while you shoot them
« Reply #37 on: February 14, 2014, 07:26:47 AM »
Cool. Thanks.
did you have any issues with series shooting longer than 5 seconds?
Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: paypal@g3gg0.de
ONLY donate for things we have done, not for things you expect!

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: io_crypt - encrypt your photos while you shoot them
« Reply #38 on: February 14, 2014, 07:48:08 AM »
Code: [Select]
ASSERT: 0
at ./Capture/Capture.c:526, task EventMgr
lv:0 mode:3


Magic Lantern version : Tragic.2014Feb13.6D113
Mercurial changeset   : 9706fb780627+ (unified) tip
Built on 2014-02-14 04:46:32 UTC by User@PC.
Free Memory  : 341K + 1661K

http://paste2.org/LVVd7x4e

Yea, It dies

g3gg0

  • Developer
  • Hero Member
  • *****
  • Posts: 3190
Re: io_crypt - encrypt your photos while you shoot them
« Reply #39 on: February 14, 2014, 09:10:28 AM »
it is some weird error.
either some memory areas are corrupted when the module is loaded, or ... hmm i dont know.
point is, even if i remove the whole encryption stuff and just cycle through a few bytes without modifying, it crashes.
making the code smaller, causes the error to disappear.

caller stack cannot be the issue. i reserve a few bytes only in a function that is calling complex FIO_ stuff which potentially needs hundreds of bytes.
also tskmon isnt ringing.
Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: paypal@g3gg0.de
ONLY donate for things we have done, not for things you expect!

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: io_crypt - encrypt your photos while you shoot them
« Reply #40 on: February 14, 2014, 09:11:50 AM »
Can you prepare a minimal working example with these few bytes?

g3gg0

  • Developer
  • Hero Member
  • *****
  • Posts: 3190
Re: io_crypt - encrypt your photos while you shoot them
« Reply #41 on: February 14, 2014, 10:06:37 AM »
yep, can prepare one.
first i wanted to check if the memory backend changes made things worse or better.

basically it was commenting out all update_key in encrypt crypt_lfsr64_encrypt and commenting out the assignments in crypt_lfsr64_xor_uint*
so the loops were iterating, but not changing anything. the assembly code was sane and just counting up registers, depending on optimization level.

alternatively running the first update_key, doing a msleep(20) and returning caused the same crash.

disabling trace module didnt help
Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: paypal@g3gg0.de
ONLY donate for things we have done, not for things you expect!

eos

  • New to the forum
  • *
  • Posts: 9
Re: io_crypt - encrypt your photos while you shoot them
« Reply #42 on: February 14, 2014, 08:33:07 PM »
[650D; P; 14.feb nightly; iocrypt 9.feb 19:44]

In review most pictures are only shown as a thumbnail with
"Cannot playback image".
 
shooting series (only tried with pw):
mostly i get an error 80 and sometimes error 70.

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: io_crypt - encrypt your photos while you shoot them
« Reply #43 on: February 15, 2014, 12:20:35 AM »
Then 650D must be wrong/still not decrypting.

Code: [Select]
    else if(streq(camera_model_short, "50D"))
    {
        trace_write(iocrypt_trace_ctx, "io_crypt: Detected 50");
        iodev_table = 0x1F208;
        iodev_ctx = 0x49A64;
        iodev_ctx_size = 0x18;
    }

Not sure on the CTX but images are taken and encrypted... just not decrypted.

g3gg0

  • Developer
  • Hero Member
  • *****
  • Posts: 3190
Re: io_crypt - encrypt your photos while you shoot them
« Reply #44 on: February 15, 2014, 11:06:44 AM »
will disable encryption when series shooting is active.
Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: paypal@g3gg0.de
ONLY donate for things we have done, not for things you expect!

g3gg0

  • Developer
  • Hero Member
  • *****
  • Posts: 3190
Re: io_crypt - encrypt your photos while you shoot them
« Reply #45 on: February 15, 2014, 03:17:49 PM »
When shoot mode is not single image mode, encryption is disabled.
this will catch the cases where shooting will fail during IO encryption.

this will also disable it in silent image mode that 5d3 and 6d (iirc) have.

of course it not the root reason, but if someone can find out where the crashes come from, please tell me.
Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: paypal@g3gg0.de
ONLY donate for things we have done, not for things you expect!

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: io_crypt - encrypt your photos while you shoot them
« Reply #46 on: February 15, 2014, 05:47:35 PM »
Did it also error on 600D and 7D in burst?

I'll have to log 50D and post here :) Same should be done for 650D

g3gg0

  • Developer
  • Hero Member
  • *****
  • Posts: 3190
Re: io_crypt - encrypt your photos while you shoot them
« Reply #47 on: February 15, 2014, 06:03:23 PM »
tried on 5d3 and 7d, both crash.
my (private) 600d is currently at a friend
Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: paypal@g3gg0.de
ONLY donate for things we have done, not for things you expect!

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: io_crypt - encrypt your photos while you shoot them
« Reply #48 on: February 15, 2014, 06:34:19 PM »
Safe to say then it crashes on all.

Marsu42

  • Contributor
  • Hero Member
  • *****
  • Posts: 1557
  • 66d + flashes
Re: io_crypt - encrypt your photos while you shoot them
« Reply #49 on: February 15, 2014, 07:19:03 PM »
this will also disable it in silent image mode that 5d3 and 6d (iirc) have.

Is this a side effect or intentional? As far as I can see, shooting in single image mode but silent shouldn't be different from vanilla non-burst mode - or am I missing some internals?