Jeffrey Young
Very Senior Member
I learned a long time ago the value of good backups. I do a rolling 31 day snap shot of both the jffs and USB using tar as a backup. Run daily from a cron job
pscp -scp -p -r -i "router.ppk" -P 5543 admin@192.168.1.1:/jffs "E:\Router\RT-AX88U\jffs"
pscp -scp -p -r -i "router.ppk" -P 5543 admin@192.168.1.1:/opt "E:\Router\RT-AX88U\entware"
plink -i "router.ppk" -P 5543 -batch admin@192.168.1.1 nvram show > "E:\Router\RT-AX88U\\nvram.txt"
why is the output significantly different to the output downloaded from the GUI? Does that mean that the GUI should not be used to restore the nvram save? Am I missing anything?nvram save mybackup.cfg
tar -cf - -C /jffs . | rclone [..etc..]
tar --to-command=md5sum -xvf jffs_386.3.tar > out1
tar --to-command=md5sum -xvf backup_jffs.tar > out2
diff out1 out2
The save file is lightly encrypted using a random number. So each file will be completely different apart from the first few bytes in the header.Concerning nvram, and:
why is the output significantly different to the output downloaded from the GUI? Does that mean that the GUI should not be used to restore the nvram save? Am I missing anything?
If the router just decrypts it and applies the settings, what's the point of the encryption in the first place? Perhaps it's salted or hashed with something indicating the router model to prevent restoring a settings file from an incompatible model?The save file is lightly encrypted using a random number. So each file will be completely different apart from the first few bytes in the header.
There's nothing clever going on, the format hasn't changed for years. It's more like obscuration than encryption. Probably because the user names and passwords were stored in nvram in plain text until very recently.If the router just decrypts it and applies the settings, what's the point of the encryption in the first place? Perhaps it's salted or hashed with something indicating the router model to prevent restoring a settings file from an incompatible model?
Yes, it's all the same file.If we save using 'nvram save' and upload using the GUI does the GUI still use the correct decryption process? I presume the 'nvram save' and 'nvram restore' encyrption/decryption is the same?
No need. There's already explanations of the encryption process online and you can look at the firmware source code to see it for yourself.Is the encryption/obfuscation just based on the output of 'nvram show'? We could presumably work out the encryption for fun?
Correct.Thanks So the encryption key is presumably stored in the output file give that it is randomly applied, so that the upload process can properly work notwithstanding the randomisation of the encryption key?
Welcome To SNBForums
SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.
If you'd like to post a question, simply register and have at it!
While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!