Vehicle and method for controlling same

The present invention relates to a vehicle which uses a CAN network as a vehicle network, and a method for controlling the same. The method for controlling a vehicle is a method for controlling a vehicle comprising a plurality of electronic control units (ECUs), the method comprising: a step in which an order in which at least one ECU of the plurality of ECUs is assigned an encryption key is allocated on the basis of a data rate of each ECU; a step in which the at least one ECU is assigned each encryption key according to the allocated order; and a step in which the at least one ECU encrypts data to be transmitted through a CAN communication bus using the encryption key assigned to the at least one ECU, or decrypts the data transmitted through the bus using the encryption key assigned to the at least one ECU.