Stochastic Energy Management And Cyber-Physical Security Of Battery Energy Storage Systems In Smart Distribution Systems