This paper describes a cybersecurity framework for protecting brain computer interface (BCI) technology. This framework consists of cybersecurity risk scenarios related to user safety/privacy and best practices to manage them. This framework provides solutions for privacy and safety issues of the existing noninvasive BCIs (e.g., electroencephalography (EEG)-based BCI). We chose to design a P300-based BCI application because it is the most popular modality, simulate some common cybersecurity attacks, and find a relevant solution to protect the user and/or integrated EEG hardware-software system. In this paper, we describe how cybersecurity risks could affect BCI form streaming/recording EEG signal in real-time until sending commands. We used EEG Equipment for measuring brain activity and Python programing language to build our experimental paradigm, record EEG signal, classify P300 components, send a message to another user, simulate some attacks, and find perfect solutions for assuring high BCI protection. This paper gives an overview of the framework, some description of BCI hacking challenges and their impact on BCI users as well as a preliminary demonstration of a P300-based BCI system with two common simple attacks.