Alex Chivers had made abusive comments and shouted "ISIL scum" in a reference to the Islamic State (ISIS) terrorist network before slapping the teenager in the face with an open packet of bacon, which is 'haram' or forbidden in Islam.
The incident happened when the victim was walking down a road in Enfield, with her mother on June 8.
"The victim was not injured, but was very distressed," the Scotland Yard said in a statement.
He used a ski mask and a motorbike helmet to cover his face during the attack and also covered his mouth, chin and neck with black clothing, but the Metropolitan Police was able to track him down using CCTV footage.
More From This Section
He was arrested six days later and charged with one count of racially or religiously aggravated common assault and one count of causing racially or religiously aggravated alarm or distress.
After pleading guilty at Highbury Corner Magistrates' Court, Chivers was sentenced this week to 26 weeks' imprisonment for the assault and 12 weeks' imprisonment for a public order offence - to run concurrently.
Met Police Detective Constable James Payne from Enfield Community Safety Unit (CSU) said: "This was a truly shocking incident. The victim was out with her mother and getting on with her day when Chivers abused her and then set upon her with something he knew would both upset and offend her."
"We know other people were present during this attack, including an associate of Chivers' who filmed the incident."
Enquiries are ongoing to trace these people and if you have any information that may assist in identifying them please contact the Community Safety Unit at Enfield via 101.
Police figures released in March had showed a considerable rise in hate crimes in London over the previous year.
The number of victims of religious and racist hate crime has risen by almost 20 per cent, from 14,004 to 16,618, and victims of faith hate have seen an 18 per cent increase from 1,699 to 2,000.