The invention discloses a portable true random code generating device which comprises a light-emitting module, an image sensor, scattering materials, a reflection piece, a control module, a USB bridging module, a USB interface, a power conversion module and a PCB. The light-emitting module, the image sensor, the FPGA control module, the USB bridging module, the USB interface and the power conversion module are all fixed on the PCB. The light-emitting module is arranged on the periphery of the image sensor, the scattering materials cover the image sensor and the light-emitting module, and the reflection piece is arranged on the scattering materials. The invention further discloses a portable true random code generating method. The portable true random code generating device is simple in structure, easy to implement, high in randomness and generation rate and low in cost, it is estimated that a real object only has the size of a USB flash disk, carrying is convenient, a USB is used for transmitting true random codes, plug and play is achieved, and using is very convenient. The process of generating the random codes does not relay on any external aids, and high safety is achieved.