Optical physically unclonable functions (PUFs) have great potential in the security identification of the internet of things. In this work, electrospun nanofibers are proposed as a candidate for a nanoscale, robust, stable and scalable PUF. The dark-field reflectance images of the polymer fibers are quantitatively analyzed by the Hough transform. We find that the fiber length and orientation distribution reach an optimal point as the fiber density (number of fibers detected by Hough ttansform) grows up over 850 in 400 × 400 pixels for a polyvinylpyrrolidone (PVP) nanofiber-based PUF device. Subsequently, we test the robustness and randomness of the PUF pattern by using the fiber amount as an encoding feature, generating a reconstruction success rate of over 80% and simultaneously an entropy of 260 bits within a mean size of 4 cm2. A scale-invariant algorithm is adopted to identify the uniqueness of each pattern on a 256-sensor device. Furthermore, the thermo-, moisture and photostability of the authentication process are systematically investigated by comparing the polyacrylonitrile to the PVP system.