The secrets of Apple Lightning - Part 1

Sdílet
Vložit
  • čas přidán 10. 02. 2023
  • Apple's proprietary Lightning connector is very well known. But do you know how it works? How is a cable authenticated? What can you do with Lightning? In this video we dive into the details of Apple's Lightning protocol - also known as SDQ and IDBUS!
    Links:
    - Twitter: / ghidraninja
    - Patreon: / stacksmashing
    - Nyan Satan's Lightning page: nyansatan.github.io/lightning/
    - My DEF CON talk on Lightning: • DEF CON 30 - stacksmas...
    - Saleae Logic Analyzer Plugin: github.com/nezza/SDQAnalyzer
  • Věda a technologie

Komentáře • 580

  • @JohnnyUtah488
    @JohnnyUtah488 Před rokem +521

    Like all true professionals, you make it look so easy! Can't wait for part 2!

  • @DodoLP
    @DodoLP Před rokem +2124

    let me guess its just USB that is missing U

    • @Leonard_MT
      @Leonard_MT Před rokem +325

      They should've called it the ASB cable, Apple Serial Bus. At least that would be honest because it's not fast nor universal.

    • @RC2225
      @RC2225 Před rokem +29

      @@Leonard_MT shouldn't it then be called adb?

    • @lesoup-mxd
      @lesoup-mxd Před rokem +141

      @@RC2225 not to be confused with Android Debug Bridge

    • @WalterMan
      @WalterMan Před rokem

      @@RC2225 Apple already made a connector called Apple Desktop Bus (ADB) and it was used for keyboards and mice.

    • @wesleymays1931
      @wesleymays1931 Před rokem +9

      @@RC2225 What would the 'd' be short for?

  • @rikschaaf
    @rikschaaf Před rokem +49

    stacksmashing: See you again soon
    * Five months later... *

  • @ballsdeepgamingcommunity9928
    @ballsdeepgamingcommunity9928 Před 9 měsíci +5

    Excellent instructions/explanations. Your voice clarity,tempo, and video presentation for some reason makes it easier to understand, learn, while also retaining the info. I had to sub and comment with my thanks for your work and expertise for me the layman.

  • @webluke
    @webluke Před rokem +433

    It would be interesting to see the results from cheap knock-off cables and other 3rd party cables to see what they spit out and if it is legitimate. The extra stuff in the cable and the communications explains the licensing Apple pushes and the increased costs. It also explains why Apple would not want to go USB-C because they would lose money, data, and control over the cables.

    • @Henry14arsenal2007
      @Henry14arsenal2007 Před rokem +55

      Doesnt help when their shitty cable works with speed standards from the year 2000.

    • @HoloScope
      @HoloScope Před rokem +19

      They did a gotcha and limited their new iPhone 15 base models to USB Type C with USB 2.0, but with the Pro Model having Thunderbolt. Touche Apple

    • @madog1
      @madog1 Před rokem +10

      I'm wondering the same thing, Apple cables are the worst for durability at the stress area where the cable meets the end. Some manufacturers do a much better job on the cable build, they last a lot longer.

    • @m7mdzuhair9gamer61
      @m7mdzuhair9gamer61 Před rokem

      They will soon

    • @Atixtasy
      @Atixtasy Před rokem +7

      @@HoloScope the EU hit them once AGAIN with their bullshit and said they cannot limit any of it. lol

  • @_yaseen
    @_yaseen Před rokem +111

    I always get excited when I see a new stacksmashing upload! Looking forward to the rest of this series

    • @ME0WMERE
      @ME0WMERE Před rokem

      stack smashing detected (core dumped)

  • @1995Links
    @1995Links Před rokem +61

    I always kind of knew there was something going on. My "genuine" apple cable would only briefly show a charge symbol before the phone would no longer respond. It seems the "genuine" chip in my cable was "taught the wrong response" hehe. Brilliant video, even a simple user like me can understand, and your graphics/editing are top notch! Another sub for your stack ;)

    • @StarmenRock
      @StarmenRock Před 5 měsíci +2

      this is so insane. the cables are a genuine and certified scam and people are so jolly about it

  • @Termynat0r
    @Termynat0r Před rokem +11

    I love your approach to reverse engineer the protocol. Waiting for part 2 :D

  • @DanDan-zs6wg
    @DanDan-zs6wg Před rokem +7

    Where’s part 2? :(

  • @GadgetUK164
    @GadgetUK164 Před rokem +23

    Cool =D You've made excellent progress there! Looking forward to part 2 =D

  • @matusholek1364
    @matusholek1364 Před rokem +2

    The algorithm just gave me this gem that I didn't know I needed to see. What a great video.

  • @noone31337
    @noone31337 Před rokem +7

    Great Video. Already waiting for Part 2 :)

  • @JLenival
    @JLenival Před rokem +2

    I need the next video! This seems like a series episode and I want to watch all the episodes. 😂
    Nice video, bro. I like to brush up some bits, and this type of video is very pleasant to me.

  • @TheXnyu
    @TheXnyu Před rokem +28

    Great video! It's really interesting to learn about the technical details of Apple's Lightning connector and how it works. I appreciate the clear explanations and diagrams, and the various links provided for further exploration. Looking forward to Part 2!

  • @shubhambora6758
    @shubhambora6758 Před rokem +3

    awesome man!! eagerly waiting for part 2

  • @ty2k
    @ty2k Před rokem +5

    Great explanation, thanks so much for all your hard work.

  • @jacobblomquist5288
    @jacobblomquist5288 Před rokem +1

    Great work! Can't wait for part 2!

  • @Jamboreeni
    @Jamboreeni Před 8 měsíci +5

    Waiting for part 2 😋

  • @mika-racing
    @mika-racing Před rokem +4

    Being a software developer in the automation industry, i love this kind of reverse engineering videos. Looking forward to the next parts ;)

  • @hellopsp180
    @hellopsp180 Před 6 měsíci +11

    part 2 when :(

  • @1blendercraft1
    @1blendercraft1 Před rokem +1

    Wow thats amazing!
    Looking very forward to the next part

  • @Marvinzock34
    @Marvinzock34 Před rokem +1

    Congrats to the 150k subcribers! and realy nice video !

  • @Muhammed.Yaseen
    @Muhammed.Yaseen Před rokem

    WOW!!!! This is such a unique video! Never seen something like this before in my feed.

  • @ranjanadissanayaka5390
    @ranjanadissanayaka5390 Před rokem +7

    Having a knowledge like yours just seems like rocket science. Just awesome

  • @duncanw9901
    @duncanw9901 Před rokem +226

    Having worked on embedded projects that communicate with iOS devices before, I'm very interested to see where this goes. Some of this I recall from the spec; other parts it seems they don't even share with their MFi partners.
    I will not be sharing more information, as I don't even remember what I can and can't legally say.

    • @kwamenaplays5899
      @kwamenaplays5899 Před rokem +13

      MFi NDA

    • @Niosus
      @Niosus Před rokem +27

      They were doing funky stuff with the 30 pin cable back in the day as well. A mix between analog and digital. I may be recalling this incorrectly, but I believe you had to do some dance applying different resistances to different pins in a specific order as part of the handshake. Really finicky stuff to get right. Different devices would react slightly differently to that handshake, to the point where even the different storage options of the same model of iPhone/iPod had an effect. You really had to test every permutation many times (50+) to be sure it worked. But take the details with a large grain of salt, I just did the testing. I remember this from hearing the engineers complain about it back then. I could be wildly wrong on the handshake part.
      I'm not worried about an NDA because I never signed anything like that with Apple. And the company where I got experience with this went bust a long time ago. Plus I don't think they really care about the 30 pin connector anymore, as long as you're not going around putting it on commercial products...

    • @rahuls4863
      @rahuls4863 Před rokem +5

      True. Like your exp, even in future, even for USB they are circumventing the standard protocol. USB already has data, power, fast charge etc. as standard - Apple is using only basic power from standard set, and they are using proprietary specs for other things (usb 3.1+ data speed, fast charge etc). All in the pretence of customer safety :)

    • @KiwisCassie
      @KiwisCassie Před rokem +5

      @@rahuls4863 as louis rossman quotes, "safety and security!"

    • @teknikal_domain
      @teknikal_domain Před rokem +3

      @@rahuls4863 I have a feeling the EU will strike them down for that.. or at least try and say "you know what we meant, we're not tolerating *malicious* compliance, do it like everyone else does"

  • @phire0
    @phire0 Před rokem +1

    Thank you for yet another fantastic video!

  • @zoltanujszaszi
    @zoltanujszaszi Před rokem

    Amazing video, waiting for part 2!

  • @tosch9057
    @tosch9057 Před rokem +1

    Looking forward to part two!

  • @john.dough.
    @john.dough. Před rokem +125

    I haven't done much research yet, but I'd be very interested in comparing the advantages and disadvantages of USB-C vs Lighting.
    Anyway, great video!

    • @makuru.42
      @makuru.42 Před rokem +57

      Advantage: more money for apple
      Disadvantage: literally everything else

    • @JamesR624
      @JamesR624 Před rokem +17

      @@makuru.42 Advantage; More durable than USB-C since there is no middle part to break.
      Advantage: Smaller than USB-C and takes up less space.

    • @griffin8062
      @griffin8062 Před rokem +44

      @@JamesR624 Is it more durable? At least in my experience, USB-C has been way more durable. Lightning cables tend to short out between pins 7 and 8

    • @operator8014
      @operator8014 Před rokem +28

      ​@@JamesR624 Lol! I have 9 year old USBC cables that still work like new. My Grandma has gone through another Apple branded lightning cable every other month since getting her polished turd of a phone.

    • @fiirasmusic5366
      @fiirasmusic5366 Před rokem +5

      @@griffin8062 not the cable, it's the port

  • @venjsystems
    @venjsystems Před rokem

    absolutely fascinating, can't wait for more videos!

  • @anthonya824
    @anthonya824 Před rokem

    My mind is blown. This video (these videos) are awesome. Thank you so much for sharing your knowledge.

  • @TheTotallyRandomGuy
    @TheTotallyRandomGuy Před rokem +7

    This is really cool!
    Also, side note, would you do this same analysis on one the old 30 pin cables? It would be really cool to see the differences between the older technology and the newer!

  • @kagandemirarslan872
    @kagandemirarslan872 Před rokem

    amazing video, cant wait part for other parts

  • @ShiroKlein
    @ShiroKlein Před rokem

    Hey, I love this video, cant wait till part 2

  • @saschakaupp
    @saschakaupp Před rokem

    Great explanation and neat graphics!

  • @desidark1243
    @desidark1243 Před rokem

    Take this subscription, you deserve it. Quality content.

  • @AKG58Z
    @AKG58Z Před rokem

    Awesome detailed video now I want to see Type c power delivery and other protocols as well from you.

  • @compu85
    @compu85 Před rokem +3

    Great video - lots of information and well paced. I'm looking forward to part 2!

  • @dogedog2447
    @dogedog2447 Před 5 měsíci +1

    This dude is pretty cool 👌 you have earned a well deserved sub 😁

  • @bjoerrrrn2005
    @bjoerrrrn2005 Před rokem

    Really love your videos. Waiting for Part 2! :-)

  • @yaghiyahbrenner8902
    @yaghiyahbrenner8902 Před rokem +1

    very nice I love the breakout header you made.

  • @miwer2010
    @miwer2010 Před 10 měsíci

    Please continue! Your work is great!!! When is the second part coming?

  • @benservey9295
    @benservey9295 Před rokem +2

    fascinating. Neat how you can figure out so much from so little

  • @matrixmodexp
    @matrixmodexp Před rokem

    Woah this is amazing. I just came from watching Exploring The simulations video on adding USBC to airpods. This is amazing to see

  • @matoatlantis
    @matoatlantis Před rokem +2

    Awesome video. Loved every bit of it (pun intended).

  • @stonedhackerman
    @stonedhackerman Před rokem

    What a madman, this video was AWESOME!

  • @Scyth3934
    @Scyth3934 Před rokem

    Can't wait to see the next video!!!

  • @EdwardMordrake618
    @EdwardMordrake618 Před rokem

    Amazing video. Please keep it going!

  • @aathish04
    @aathish04 Před rokem +62

    Hey, awesome video, loved all the technical details!
    On a side note, what kind of logic analyser would you recommend for someone just getting into hardware security? The Salae ones you showed are a little outside my undergrad budget ;)
    Will an ESP32/Raspberry Pi Pico suffice for most beginner usecases? What if I'm dealing with negative voltage signals?
    Many thanks for your videos! Got here after LiveOverflow recommended them :)

    • @stacksmashing
      @stacksmashing  Před rokem +35

      You can get some very cheap ones on Amazon (like $10) - I think those are great in the beginning (and I still often use them)

    • @aathish04
      @aathish04 Před rokem +9

      @@stacksmashing alright, I'll have a look at those. Thank you so much!

    • @Neywiny
      @Neywiny Před rokem +3

      @@aathish04 I've used micros in the past, they're nice but one bit me when it pulled my i2c lines low when it wasn't powered. I use a digital discovery at work and it's amazing, especially with its high speed adapter kit. Very clean signals.

    • @newmonengineering
      @newmonengineering Před rokem +2

      Personally I bought a 70$ one on Amazon and it does more than enough for me. Have used it a good bit. Probably the 10$ one would be enough for most to be honest

  • @DEMENTO01
    @DEMENTO01 Před rokem +1

    this is so interesting wow! im now very curious about a few things tho.
    1- How do splitters work? for example i have a very cheap aliexpress splitter that basically lets me plug in both charging cable and lightning earpods on my iphone at once, im guessing this thing is 100% passive but i have no ide and im not about to destroy it rn tbh. but if its passibe how can it communicate with both things at once? and if active, how does it get to split these two things?
    2- does the cable reply to the device which charging capabilities it has? like if it can do fast charging or not, or is that linked to the modle number or name itself?
    3- does the cable also talk to the charger it connects to? like does the apple PSU get any information about the lightning cable or device? apart from power delivery on fast chargers that is, especially curious on the old usb-a 5w and 10w ones
    and 4- how do fake cables work then? ive had bad luck getting some knockoff ones bc they would charge very very slowly and im thinking if it might be bc the controller was answering stuff wrong and the iphone has some sort of anti-illegitimate mehcanism or something or if it just replied as if it was the slowest charging cable that exists, i really hope youll check this stuff at some point plz!
    btw for reference this is the splitter i have (different store same thing tbh, not great bc it requires regular cleaning for it to work, also if u dont have experienc with aliexpress choose the aliexpress saver shipping unless its wayy too expensive for u bc at least in spain that option takes 2 weeks but the caniao expedited economy aka tghe default one for this takes months) www.aliexpress.com/item/1005004576959652.html

  • @suncrafterspielt9479
    @suncrafterspielt9479 Před rokem

    would love a second part if you have time :D

  • @zUltraXO
    @zUltraXO Před rokem

    This was honestly really interesting to watch

  • @rouuuk
    @rouuuk Před rokem

    im sold, new sub over here, im waiting for part 2

  • @seanperez1210
    @seanperez1210 Před 7 měsíci +2

    This is great part 2 can’t wait … there are some interesting other projects that might be able to be integrated with that tamarin cable, not very sure what “level” of signal processor / logic analyzer is required. But I have seen some open source logic analyzer on hackaday that use the PIO cores to get up to 24 channels , 16, 8… pretty sure you could pipe the GPIO that’s handling that communication into the other cores and have the ARM cores act like a TCP server to send the data through the USB connected to the PC to double as tamarin / logic analyzer .
    Very cool project hope there is part 2 , and maybe some Lightning peripherals? Like lightning to usb hdmi hubs ? Get the readings from those ?

  • @nooranshdhaka
    @nooranshdhaka Před rokem +1

    This was such a dope video when part 2 gonna drop it’s been 4 months

  • @DamienBOURSAUX
    @DamienBOURSAUX Před 4 měsíci

    Wow. As an Apple employee at a Genius Bar, this video brought me a lot. As I love giving my customers some details about their products, this is a lot! Until now, just said that their cable is not only a cable. Now I can explain that there’s a real chip with which the iPhone is talking to.
    In an other way, can’t understand why we have not tools to determine if a cable is genuine or not.

  • @Amyunus
    @Amyunus Před rokem

    Omg you are explaining it very very well done 👏🏾

  • @hardundware
    @hardundware Před rokem

    Wow. Heavy nice work Bro. Thanks 🙏 4 content

  • @nicknorthcutt7680
    @nicknorthcutt7680 Před 5 měsíci +1

    You are super good at reverse engineering. Extremely straight forward and informative.

  • @garydunken7934
    @garydunken7934 Před rokem

    Wow, nice one. For how long did this channel exist? Subscribed.

  • @AshishEmbedd
    @AshishEmbedd Před rokem

    Awesome thanks for explaining in depth.

  • @ra1nmaker001
    @ra1nmaker001 Před rokem +1

    Eagerly waiting for part 2!

  • @Moker49
    @Moker49 Před rokem +2

    "in the next video?" what!? fastest 9 mins ever. what an awesome video.

  • @1fattyfatman
    @1fattyfatman Před 5 měsíci

    I have no interest in this space but LOVED this vid because it as so clear and well produced.

  • @kritikusi-666
    @kritikusi-666 Před rokem +2

    Great to see you back on the scene. Superb content delivery. Are you planning on working on a possible jailbreak?

  • @mprebbz
    @mprebbz Před rokem

    Respect man. You are truly awesome

  • @Schimnesthai
    @Schimnesthai Před rokem +1

    This is excellent!

  • @parimalarenga92
    @parimalarenga92 Před rokem

    you remind me of Ben Eater, not comparing efforts here, great video. subbed.

  • @TheStringBreaker
    @TheStringBreaker Před rokem

    *Amazing video!*

  • @rebootretro
    @rebootretro Před rokem

    This outdoes the video I uploaded about Lightning cables, lol. Excellent job! Very informative!

    • @stacksmashing
      @stacksmashing  Před rokem

      Oh do you have a link to that? Do you mean this one? czcams.com/video/loVJTLUzA-k/video.html
      Nice channel :)

    • @rebootretro
      @rebootretro Před rokem

      @@stacksmashing Thank you! Although I still somewhat envy your technical abilities, haha. I've worked with electronics for a very long time, but I wish I was more proficient with logic analyzers, scopes, etc. I've seen your videos before, particularly the AirTag one. Excellent stuff!

  • @pallzoltan
    @pallzoltan Před rokem

    This is so incredibly awesome

  • @l3yce583
    @l3yce583 Před rokem

    Love the content 👍

  • @seanho123
    @seanho123 Před rokem +1

    Been waiting for pt.2 for two months now

  • @bnk28zfp
    @bnk28zfp Před rokem

    thank you!! can wait what next!!!

  • @Josh.Davidson
    @Josh.Davidson Před rokem

    Great video!

  • @frequencymanipulator
    @frequencymanipulator Před rokem

    This video got me all charged up. Positively electrifying.

  • @rafaelcoelho5226
    @rafaelcoelho5226 Před rokem

    Awesome video

  • @ttxb
    @ttxb Před rokem

    you are a gem!!! thank you for this video.

  • @asminsilwal5518
    @asminsilwal5518 Před rokem

    This is interesting. Thanks for sharing.

  • @hkfuertes
    @hkfuertes Před rokem +1

    Really really interesting.... Dumb question/idea.... Would it be possible via rpi0 or RPI pico to convert video signal from lightning to uvc USB gadget mode?

  • @MxGiK3HuNNx
    @MxGiK3HuNNx Před rokem

    Keep up the good work

  • @Fewnity
    @Fewnity Před rokem

    I want the next video this is so cool!

  • @blasalvadorwii
    @blasalvadorwii Před rokem

    Very interesting video !

  • @Nathan123Bhi8
    @Nathan123Bhi8 Před rokem +1

    Algorithm sent me here, and I’m glad! Can’t wait for the rest!

  • @JRis44
    @JRis44 Před rokem

    Guess I have to subscribe to stay tuned!!
    Also what analyzer do you use?!?!

  • @schmidvid
    @schmidvid Před rokem +1

    Didn’t understand a single word, but hey man, nice video, enjoyed it 😄

  • @danrichman1
    @danrichman1 Před 4 měsíci

    Fascinating! Thank you.

  • @benhernandez9571
    @benhernandez9571 Před rokem

    Wonderful video. Thank you!

  • @EmadSaeed
    @EmadSaeed Před rokem

    awesome content 👏

  • @mohamedadam5215
    @mohamedadam5215 Před rokem

    Awesome video! =)

  • @alexnoha
    @alexnoha Před rokem +3

    Before watching the video, I thought that embedding the chip in the USB cable was stupid, because it costs more and creates more waste.
    Now, I'm waiting for the next part.

  • @seanho123
    @seanho123 Před 11 měsíci +5

    Waiting for pt.2 for 6 months now

  • @itemushmush
    @itemushmush Před rokem

    Wow you are a great communicator!

  • @EpicLPer
    @EpicLPer Před rokem +1

    I wonder, would this be able to debug an issue on a dumpster iPhone I found recently? I failed to flash iOS onto it, no matter if recovery or DFU mode, it always errors out or reboots at some point unexpectedly, and I have no idea what's wrong with it. I suspect a broken flash chip, but I can't tell for sure.

    • @stacksmashing
      @stacksmashing  Před rokem

      I doubt it to be honest :)

    • @michealfunickrr3717
      @michealfunickrr3717 Před rokem

      Send it to me. One of my iPhone's rudely erased all data on me after changing passcode. 2 failed attempts and I freaked out shut off the phone (despite the glitch yes the GLITCH) I rebooted the iPhone thinking it'll solve the glitch but I did not know what I just done and bam first passcode attempt and it is erased everything. (It may have been poor wifi during request passcode change so from now on anytime I change it I make sure wifi is flawless beforehand!)
      Anyways the point: this erased iPhone can still jailbreak using i2c box and even shows the iOS version 13.6.0 I am blaming Apple here. If it did erase "all data" then why the heck is it able to do this? P.S. This type stuff makes me want to sue company. False advertising IMO.

  • @ahmedtwahir
    @ahmedtwahir Před rokem +2

    Wow, very great explanation. I was wondering if it's the same thing with the PMICs shorting out on the 6 and 6s+, does it explain the PMIC shorting when plugged with a non-genuine cable? Or is it just coincidence ?

  • @BD7PA
    @BD7PA Před rokem

    Thank you for your very detailed technical sharing, why can't I find the second part, thank you.

  • @rolandgerard6064
    @rolandgerard6064 Před rokem

    You make great video.

  • @testizoizo7373
    @testizoizo7373 Před rokem

    Nice video 👍

  • @johnadams6249
    @johnadams6249 Před rokem +15

    fun fact, iPad Pro gen 1 and 2 use all 16 pins on lightning for usb 3.0 speeds (in conjunction with a usb-c to lightning cable)

  • @serggorod1423
    @serggorod1423 Před rokem

    Good used analyser experience !