Quick & Dirty test of the ciphering functions

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

Sylvain Munaut 246tnt at gmail.com
Thu Sep 24 00:13:45 UTC 2009


Hi everyone,


This evening I spent a few hours hacking a small test to activate
ciphering and I tought people might be interested with tinkering with
it. If you want to try for yourself, start off from the encryption
branch of Harald, then apply the 4 patches I just posted to this list
then apply the quick hack attached to this message.

This patch is not for merge since it's a gross hack just 'to see if it
works', and it does ! ( See the log in attachment )

What this patch does is pretty simple:
 - When there is a location update, it does a AUTHENTICATION REQUEST
with a static RAND.
 - When the AUTHENTICATION RESPONSE is received, it compares the
result with the 'known expected' results (see the wiki for AT commands
to get SRES and Kc for a given RAND)
 - When sending a SMS to the MS, it activates the ciphering after
receiving the paging response with the 'known precomputed' Kc. If
everything goes well, the ME sends back a CIPHER MODE COMPLETE and the
rest of the talk is ciphered.

The included patch uses A5/2 but can be trivially modified for A5/1. I
just wanted to see if the iPhone would accept A5/2 and it doesn't
(works with A5/1 tough) ! My old Ericsson T610 takes A5/2 and A5/1.


Of course, this is no where near a good implementation but at least it
provides proof that the lower level functions works. I'm not sure
what's the best solution to get SRES and Kc. Most of the time getting
the Ki is not an option, so either we have a fixed RAND, or a bunch
RAND and corresponding SRES and Kc ... Or a side channel to run the
algo on the phone itself ...


   Sylvain
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-HACK-TO-TEST-CIPHERED-SMS-DELIVERY-IN-A5-2.patch
Type: application/octet-stream
Size: 3291 bytes
Desc: not available
URL: <http://lists.osmocom.org/pipermail/openbsc/attachments/20090924/a891e414/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cipher.log
Type: application/octet-stream
Size: 7353 bytes
Desc: not available
URL: <http://lists.osmocom.org/pipermail/openbsc/attachments/20090924/a891e414/attachment-0001.obj>


More information about the OpenBSC mailing list