Measuring and enhancing the security of machine learning