SSH client

...
  • Well Done!

    I hope, We will get SSH soon :)
    ---
    Check out the Netsurf Web Browser for KolibriOS.
    Read the wiki and happy hacking with KolibriOS!
  • Math enthusiasts may certainly improve current modular exponentiation routines.
    Which routines? Can you test performance, to make sure it will not become worse?
    Last edited by Pathoswithin on Mon May 09, 2016 12:36 am, edited 1 time in total.
  • Good news!! :)
    Also good news for development of TLS library :wink:
    Kolibri <3
  • Which routines? Can you test performance, to make sure it will not become worse?
    I'm talking about the multi precision math routines in mpint.inc

    It comes with a demo/test program (modexp.asm) which may easily be enhanced to measure time a certain calculation takes.

    One of the things is; now almost every math routine is hard-coded to work on 'MAX_BITS' bits, while the true length of a number will be less in reality. This now requires extra zeros, extra calculations and more space, but easier routines.
    "Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." Albert Einstein
  • So, the main routine is mpint_modexp? And why do you think these routines can be much improved? Do we even need more performance?
  • Pathoswithin wrote:So, the main routine is mpint_modexp? And why do you think these routines can be much improved? Do we even need more performance?
    We _always_ need more performance. It is especially useful in libraries because a lot of userspace programs might use it in the future and the library shouldnt be a bottleneck.
    ---
    Check out the Netsurf Web Browser for KolibriOS.
    Read the wiki and happy hacking with KolibriOS!
  • If I understand correctly, these routines will be used for key encryption, not the data itself? In that case, their part will be miserable.
    Maybe I can improve mpint_mul routine, but test shows clearly, that the bottleneck is mpint_mod, and I doubt something can be done with it.
    Attachments
    modexp.asm (2.88 KiB)
    Downloaded 357 times
  • The modular exponentiation is required during key exchange, this is at connection time, but also later while re-keying after x bytes of data or x hours have passed.

    I hear that the use of Karatsuba multiplication algorithm and or Montgomery reduction algorithm may be useful.
    "Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." Albert Einstein
  • #9070, almost useable..
    "Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." Albert Einstein
  • Congratulations!

    How many years did it take to publish this MVP?
    How many side projects did you have to implement to actually start working on SSH protocol itself?
  • Dunkaist: It is quite the question! I'll try to give a sensible answer without boring all possible readers :)

    Actually, when I started working on KolibriOS project, I just wanted to write some network programs.
    Soon I got frustrated with the capabilities of the then current network stack and started rewrite of the network stack. (#1)
    One thing led to another, and many hours and lines of code later, it got merged into trunk and development is still ongoing.
    (The scope of this 'side project' is hard to explain, it involved rewrite of everything network related: applications, drivers, protocol handlers and all glue in between.)

    For SSH client specific, of course some encryption related components are needed.
    We are building on the work of giants here, so no need to invent anything, I just wanted a clean implementation in FASM of the needed components.
    I did not have to write any block ciphers (thanks to Dunkaist for AES, Echo for BlowFish, and possibly others)
    but did write some code for the block chaining (CBC/CTR/..) (#2)
    During Google Summer of Code 2016 I mentored a student by the name of Denis Karpenko who worked on TLS for KolibriOS. (#3)
    One of the lasting outcomes of this is the implementation of HMAC written mostly by Denis. (With SHA256, SHA1 and MD5 from libcrash, developed by you guessed it: Dunkaist)
    But then, the real pain for me.. Modular Exponentiation of large integers needed for Diffie-Hellman handshake. (#4)
    This code has been written from scratch and pushed me out of my comfort zone.
    Only some days ago, I admitted to myself that testing mathematical code like this is impossible 'in-place'.
    You need test vectors, and preferably a lot of them. So I found some we could use, applied them and fixed the code. (#5)
    To be honest, the writing of test program felt like a boring side project, but it is absolutely necessary and was very satisfying to see it PASS!

    I must have forgotten at least half the story, but this might give an impression.
    I really should fix some issues with PRNG now before someone actually decides to use this :)
    Last edited by hidnplayr on Wed Jul 21, 2021 6:06 pm, edited 1 time in total.
    "Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." Albert Einstein
  • Wow, that was an interesting reading,
    and you did a great job passing a long way!
    Из хаоса в космос
  • Version 0.05 #9106. Quite useable.
    (Requires latest revision of console.obj)
    Attachments
    VirtualBox_KolibriOS_31_07_2021_21_40_33.png
    VirtualBox_KolibriOS_31_07_2021_21_40_33.png (16.92 KiB)
    Viewed 8323 times
    VirtualBox_KolibriOS_31_07_2021_21_40_25.png
    VirtualBox_KolibriOS_31_07_2021_21_40_25.png (17.74 KiB)
    Viewed 8323 times
    VirtualBox_KolibriOS_31_07_2021_21_40_09.png
    VirtualBox_KolibriOS_31_07_2021_21_40_09.png (11.49 KiB)
    Viewed 8323 times
    "Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." Albert Einstein
  • Who is online

    Users browsing this forum: No registered users and 4 guests