When you buy an e-bike it's a package deal, bike, batteries, software. The software is integral to the safety and longevity of the batteries, the performance of the bike, future warranty expenses of the manufacturers, etc. So they encrypt the software (and the software access to the hardware)...