Police discovered fragments of text on Dart's laptop that revealed that the pair had used the computer to have a "silent conversation" to avoid possible surveillance bugs.
They would open a Word document and take it in turns to type, before deleting the text and mistakenly assumed that none of it would be stored on the machine.
However forensic experts were able to plough through 2,000 pages of computer code to decipher fragments of what was said.
These included Mahmood making a reference to Wootton Bassett and then adding "if it comes down to it it's that or even just to deal with a few MI5 MI6 heads".
More top news
Scotland Yard said the male youths will appear in custody at Westminster Magistrates' Court on Saturday.
Windy this weekend with gales across northwestern parts of the UK. Rain spreading southeast.
Greater Manchester Police said "inquiries are ongoing to fully understand the circumstances of the incident."